{"id":16913091,"url":"https://github.com/inercia/terraform-provider-kubeadm","last_synced_at":"2025-03-22T10:32:16.981Z","repository":{"id":146852200,"uuid":"87063457","full_name":"inercia/terraform-provider-kubeadm","owner":"inercia","description":"A Terraform provider/provisioner for deploying Kubernetes with kubeadm","archived":false,"fork":false,"pushed_at":"2020-05-05T13:47:55.000Z","size":42125,"stargazers_count":69,"open_issues_count":13,"forks_count":20,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-18T10:38:04.725Z","etag":null,"topics":["containers","go","golang","golang-tools","infrastructure-as-code","infrastructure-management","kubeadm","kubernetes","kubernetes-cluster","terraform","terraform-provider","terraform-provisioner"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inercia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"docs/Roadmap.md","authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-03T10:42:21.000Z","updated_at":"2024-10-12T15:56:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"ebcc8fbb-1eaa-484d-9ccf-73abbd92d13d","html_url":"https://github.com/inercia/terraform-provider-kubeadm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inercia%2Fterraform-provider-kubeadm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inercia%2Fterraform-provider-kubeadm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inercia%2Fterraform-provider-kubeadm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inercia%2Fterraform-provider-kubeadm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inercia","download_url":"https://codeload.github.com/inercia/terraform-provider-kubeadm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244944222,"owners_count":20536290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["containers","go","golang","golang-tools","infrastructure-as-code","infrastructure-management","kubeadm","kubernetes","kubernetes-cluster","terraform","terraform-provider","terraform-provisioner"],"created_at":"2024-10-13T19:12:10.463Z","updated_at":"2025-03-22T10:32:16.975Z","avatar_url":"https://github.com/inercia.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform kubeadm plugin\n\n[![Build Status](https://travis-ci.org/inercia/terraform-provider-kubeadm.svg?branch=master)](https://travis-ci.org/inercia/terraform-provider-kubeadm)\n\nA [Terraform](https://terraform.io/) `resource` definition and `provisioner`\nthat lets you install Kubernetes on a cluster.\n\nThe underlying `resources` where the `provisioner` runs could be things like\nAWS instances, `libvirt` machines, LXD containers or any other\nresource that supports SSH-like connections. The `kubeadm` `provisioner`\nwill run over this SSH connection all the commands necessary for installing\nKubernetes in those resources, according to the configuration specified in\nthe `resource \"kubeadm\"` block.\n\n## Example\n\nHere is an example that will setup Kubernetes in a cluster\ncreated with the Terraform [libvirt](github.com/dmacvicar/terraform-provider-libvirt/)\nprovider:\n\n```hcl\nresource \"kubeadm\" \"main\" {\n  api {\n    external = \"loadbalancer.external.com\"   # external address for accessing the API server\n  }\n  \n  cni {\n    plugin = \"flannel\"   # could be 'weave' as well...\n  }\n  \n  network {\n    dns_domain = \"my_cluster.local\"  \n    services = \"10.25.0.0/16\"\n  }\n  \n  # install some extras: helm, the dashboard...\n  helm      { install = \"true\" }\n  dashboard { install = \"true\" }\n}\n\n# from the libvirt provider\nresource \"libvirt_domain\" \"master\" {\n  name = \"master\"\n  memory = 1024\n  \n  # this provisioner will start a Kubernetes master in this machine,\n  # with the help of \"kubeadm\" \n  provisioner \"kubeadm\" {\n    # there is no \"join\", so this will be the first node in the cluster: the seeder\n    config = \"${kubeadm.main.config}\"\n\n    # when creating multiple masters, the first one (the _seeder_) must join=\"\",\n    # and the rest will join it afterwards...\n    join      = \"${count.index == 0 ? \"\" : libvirt_domain.master.network_interface.0.addresses.0}\"\n    role      = \"master\"\n\n    install {\n      # this will try to install \"kubeadm\" automatically in this machine\n      auto = true\n    }\n  }\n\n  # provisioner for removing the node from the cluster\n  provisioner \"kubeadm\" {\n    when   = \"destroy\"\n    config = \"${kubeadm.main.config}\"\n    drain  = true\n  }\n}\n\n# from the libvirt provider\nresource \"libvirt_domain\" \"minion\" {\n  count      = 3\n  name       = \"minion${count.index}\"\n  \n  # this provisioner will start a Kubernetes worker in this machine,\n  # with the help of \"kubeadm\"\n  provisioner \"kubeadm\" {\n    config = \"${kubeadm.main.config}\"\n\n    # this will make this minion \"join\" the cluster started by the \"master\"\n    join = \"${libvirt_domain.master.network_interface.0.addresses.0}\"\n    install {\n      # this will try to install \"kubeadm\" automatically in this machine\n      auto = true\n    }\n  }\n\n  # provisioner for removing the node from the cluster\n  provisioner \"kubeadm\" {\n    when   = \"destroy\"\n    config = \"${kubeadm.main.config}\"\n    drain  = true\n  }\n}\n```\n\nNote well that:\n\n* all the `provisioners` must specify the `config = ${kubeadm.XXX.config}`,\n* any other nodes that _join_ the _seeder_ must specify the\n`join` attribute pointing to the `\u003cIP/name\u003e` they must _join_. You can use\nthe optional `role` parameter for specifying whether it is joining as a\n`master` or as a `worker`. \n\nNow you can see the plan, apply it, and then destroy the\ninfrastructure:\n\n```console\n$ terraform plan\n$ terraform apply\n$ terraform destroy\n```\n\nYou can find examples of the privider/provisioner in other environments like OpenStack, LXD, etc. in the [examples](docs/examples) directory)\n\n## Features\n\n* Easy deployment of kubernetes clusters in any platform supported\nby Terraform, just adding our `provisioner \"kubeadm\"` in the machines\nyou want to be part of the cluster.\n  * All operations are performed through the SSH connection created by Terraform, \n  so you can create a k8s cluster in completely isolated machines.\n* Multi-master deployments. Just add a Load Balancer that points\nto your masters and you will have a HA cluster!.  \n* Easy _scale-up_/_scale-down_ of the cluster by just changing the\n`count` of your masters or workers.\n* Use the [`kubeadm` attributes](../../wiki/Resource_kubeadm#attributes-reference)\nin other parts of your Terraform script. This makes it easy to do things like:\n  * enabling SSL termination by using the certificates generated for `kubeadm`\n   in the code you have for creating your Load Balancer.\n  * create machine _templates_ (for example, `cloud-init` code) that can \n  be used for creating machines dynamically, without Terraform being involved\n  (like _autoscaling groups_ in AWS).\n* Automatic rolling upgrade of the cluster by just changing the base\nimage of your machines. Terraform will take care of replacing old\nnodes with upgraded ones, and this provider will take care of draining\nthe nodes.\n* Automatic deployment of some _addons_, like CNI drivers, the k8s Dashboard,\nHelm, etc.  \n\n(check the [TODO](../../wiki/Roadmap) for an updated list of features).  \n\n## Status\n\nThis `provider`/`provisioner` is being actively developed, but I would still consider\nit **ALPHA**, so there can be many rough edges and some things can change without\nany previous notice. To see what is left or planned, see the\n[issues list](https://github.com/inercia/terraform-provider-kubeadm/issues) and the\n[roadmap](../../wiki/Roadmap).\n\n## Requirements\n\n* [Terraform](https://www.terraform.io)\n* Go \u003e= 1.12 (for compiling)\n\n## Quick start\n\n```console\n$ mkdir -p $HOME/.terraform.d/plugins\n$ # with go\u003e=1.12\n$ go build -v -o $HOME/.terraform.d/plugins/terraform-provider-kubeadm \\\n    github.com/inercia/terraform-provider-kubeadm/cmd/terraform-provider-kubeadm\n$ go build -v -o $HOME/.terraform.d/plugins/terraform-provisioner-kubeadm \\\n    github.com/inercia/terraform-provider-kubeadm/cmd/terraform-provisioner-kubeadm\n```\n\n## Documentation\n\n* More details on the [installation](../../wiki/Installation) \ninstructions.\n* Using `kubeadm` in your Terraform scripts:\n  * The [`resource \"kubeadm\"`](../../wiki/Resource_kubeadm) configuration\n  block.\n  * The [`provisioner \"kubeadm\"`](../../wiki/Provisioner_kubeadm)\n  block.\n  * [Additional stuff](../../wiki/Additional_tasks) ncessary for \n  having a fully functional Kubernetes cluster, like installing\n  CNI, the dashboard, etc...\n* Deployment examples for:\n  * [AWS](docs/examples/aws/README.md)\n  * [libvirt](docs/examples/libvirt/README.md)\n  * [lxd](docs/examples/lxd/README.md)\n  * [Docker-in-Docker](docs/examples/dnd/README.md)\n* [Roadmap, TODO and vision](../../wiki/Roadmap).\n* [FAQ](../../wiki/FAQ).\n\n## Running the tests\n\nYou can run the unit tests with:\n\n```console\n$ make test\n```\n\nThere are [end-to-end tests](tests/e2e) as well, that can be launched with\n\n```console\n$ make tests-e2e\n```\n\n## Author(s)\n\n* Alvaro Saurin \\\u003calvaro.saurin@gmail.com\\\u003e\n\n## License\n\n* Apache 2.0, See LICENSE file\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finercia%2Fterraform-provider-kubeadm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finercia%2Fterraform-provider-kubeadm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finercia%2Fterraform-provider-kubeadm/lists"}