{"id":15156001,"url":"https://github.com/linode/terraform-linode-k8s","last_synced_at":"2025-09-30T04:32:07.081Z","repository":{"id":33559183,"uuid":"149634026","full_name":"linode/terraform-linode-k8s","owner":"linode","description":"Kubernetes installer for Linode","archived":true,"fork":false,"pushed_at":"2023-06-23T20:32:58.000Z","size":1636,"stargazers_count":67,"open_issues_count":8,"forks_count":37,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-02-19T12:55:58.990Z","etag":null,"topics":["hcl","kubernetes","linode","terraform","terraform-module"],"latest_commit_sha":null,"homepage":"https://developers.linode.com/kubernetes/","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-20T15:52:06.000Z","updated_at":"2024-07-19T20:09:35.000Z","dependencies_parsed_at":"2024-09-26T19:01:10.857Z","dependency_job_id":"f7124e2c-511e-425c-b762-4ed26eafca38","html_url":"https://github.com/linode/terraform-linode-k8s","commit_stats":{"total_commits":224,"total_committers":20,"mean_commits":11.2,"dds":0.7633928571428572,"last_synced_commit":"efc69bb2a30a0a4982cb721e8ac40b366a61d29c"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/linode/terraform-linode-k8s","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linode%2Fterraform-linode-k8s","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linode%2Fterraform-linode-k8s/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linode%2Fterraform-linode-k8s/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linode%2Fterraform-linode-k8s/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linode","download_url":"https://codeload.github.com/linode/terraform-linode-k8s/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linode%2Fterraform-linode-k8s/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277632338,"owners_count":25850732,"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","status":"online","status_checked_at":"2025-09-30T02:00:09.208Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["hcl","kubernetes","linode","terraform","terraform-module"],"created_at":"2024-09-26T19:00:55.501Z","updated_at":"2025-09-30T04:32:06.702Z","avatar_url":"https://github.com/linode.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kubernetes Terraform installer for Linode Instances\n\n:warning: | This project is experimental and should not be used in production environments.\n:---: | :---\n\n\nThis Terraform module creates a Kubernetes Cluster on Linode Cloud infrastructure running Ubuntu. The cluster is designed to take advantage of the Linode regional private network, and is equiped with Linode specific cluster enhancements.\n\nCluster size and instance types are configurable through Terraform variables.\n\n## Validated configurations\n\nk8s_version|docker_version|cni_version|crictl_version|k8s_feature_gates\n---|---|---|---|---\nv1.19.6|19.03|v0.8.7|v1.15.0|\nv1.18.13|19.03|v0.8.7|v1.15.0|\nv1.17.16|19.03|v0.8.7|v1.15.0|\nv1.16.15|19.03|v0.8.7|v1.15.0|\n\n## Install\n\n### Prerequisites\n\n* Terraform must be installed\n* Bash must be installed\n* SSH should be installed and configured with an SSH Key and Agent (Recommended)\n* Having kubectl installed is recommended\n\nNote that you'll need Terraform v0.10 or newer to run this project.\n\n### Linode API Token\n\nBefore running the project you'll have to create an access token for Terraform to connect to the Linode API.\nUsing the token and your access key, create the `LINODE_TOKEN` environment variable:\n\n```bash\nread -sp \"Linode Token: \" TF_VAR_linode_token # Enter your Linode Token (it will be hidden)\nexport TF_VAR_linode_token\n```\n\nThis variable will need to be supplied to every Terraform `apply`, `plan`, and `destroy` command using `-var linode_token=$LINODE_TOKEN` unless a `terraform.tfvars` file is created with this secret token.\n\n## Usage\n\nCreate a `main.tf` file in a new directory with the following contents:\n\n```hcl\nmodule \"k8s\" {\n  source  = \"linode/k8s/linode\"\n\n  linode_token = \"YOUR TOKEN HERE\"\n}\n```\n\nThat's all it takes to get started!\n\nPin to a specific module version using `version = \"...\"` to avoid upgrading to a version with breaking changes.  Upgrades to this module could potentially replace all master and worker nodes resulting in data loss.  The `terraform plan` will report this, but it may not be obvious.\n\n```hcl\nmodule \"k8s\" {\n  source  = \"linode/k8s/linode\"\n  version = \"0.1.0\"\n\n  linode_token = \"YOUR TOKEN HERE\"\n}\n```\n\nChoose a Terraform workspace name (because the default is `default`).  In this example we've chosen `linode`.  The workspace name will be used as a prefix for Linode resource created in this cluster, for example: `linode-master-1`, `linode-node-1`.  Alternate workspaces can be created and selected to change clusters.\n\n```bash\nterraform workspace new linode\n```\n\nCreate an Linode Kubernetes cluster with one master and a node:\n\n```bash\nterraform apply \\\n -var region=eu-west \\\n -var server_type_master=g6-standard-2 \\\n -var nodes=1 \\\n -var server_type_node=g6-standard-2 \\\n```\n\nThis will do the following:\n\n* provisions Linode Instances in parallel with Ubuntu 20.04 (the Linode instance type/size of the `master` and the `node` may be different)\n* connects to the Linode Instances via SSH and installs various Kubernetes components and supporting binaries: [kubeadm](https://kubernetes.io/docs/reference/setup-tools/kubeadm/), [kubectl](https://kubernetes.io/docs/reference/kubectl/overview/), [kubelet](https://kubernetes.io/docs/concepts/overview/components/#kubelet), [kubernetes-cni](https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/#cni), and [crictl](https://kubernetes.io/docs/tasks/debug-application-cluster/crictl/).\n* installs a Calico network between Linode Instances\n* runs kubeadm init on the master server and configures kubectl\n* joins the nodes in the cluster using the kubeadm token obtained from the master\n  * installs Linode add-ons:\n    * [CSI](https://github.com/linode/linode-blockstorage-csi-driver) (LinodeBlock Storage Volumes)\n    * [CCM](https://github.com/linode/linode-cloud-controller-manager) (Linode NodeBalancers)\n    * [External-DNS](https://github.com/kubernetes-incubator/external-dns/blob/master/docs/tutorials/linode.md) (Linode Domains)\n  * installs cluster add-ons:\n    * [Kubernetes dashboard](https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/)\n    * [Metrics Server](https://kubernetes.io/docs/tasks/debug-application-cluster/resource-metrics-pipeline/#metrics-server)\n* copies the kubectl admin config file for local `kubectl` use via the public IP of the API server\n\nA full list of the supported variables are available in the [Terraform Module Registry](https://registry.terraform.io/modules/linode/k8s/linode/?tab=inputs).\n\nAfter applying the Terraform plan you'll see several output variables like the master public IP,\nthe `kubeadmn join` command and the current workspace admin config (for use with `kubectl`).\n\nThe cluster node count can be scaled up by increasing the number of Linode Instances acting as nodes:\n\n```bash\nterraform apply -var nodes=3\n```\n\nTear down the whole infrastructure with:\n\n```bash\nterraform destroy -force\n```\n\nBe sure to clean-up any CSI created Block Storage Volumes, and CCM created NodeBalancers that you no longer require.\n\n### Remote control\n\nThe `kubectl` config file format is `\u003cWORKSPACE\u003e.conf` as in `linode.conf`.  Kubectl will use this file when provided through `--kubeconfig` or when set in the `KUBECONFIG` environment variable.\n\nIf you have `kubectl` install locally, you can use it to work with your Linode cluster.  You can always ssh into the master Linode Instance and run `kubectl` there (without the `--kubeconfig` option or environment variable).\n\n```bash\n$ export KUBECONFIG=\"$(pwd)/$(terraform output kubectl_config)\"\n$ kubectl top nodes\n\nNAME           CPU(cores)   CPU%      MEMORY(bytes)   MEMORY%\nlinode-master-1   655m         16%       873Mi           45%\nlinode-node-1     147m         3%        618Mi           32%\nlinode-node-2     101m         2%        584Mi           30%\n```\n\nIn order to access the dashboard locally, you can use `kubectl proxy` then browse to \u003chttp://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy\u003e\n\n```bash\n$ kubectl proxy \u0026\n[1] 37630\nStarting to serve on 127.0.0.1:8001\n```\n\nTo authenticate, provide the [kubeconfig file or generate a token](https://github.com/kubernetes/dashboard/wiki/Access-control#authentication).  For demonstrative purposes, an existing system token can be used.  This is not recommended for production clusters.\n\n```bash\nkubectl -n kube-system describe secrets `kubectl -n kube-system get secrets | awk '/clusterrole-aggregation-controller/ {print $1}'` | awk '/token:/ {print $2}'\n```\n\n![Overview](https://github.com/linode/terraform-linode-k8s/blob/master/screens/dash-overview.png)\n\n![Nodes](https://github.com/linode/terraform-linode-k8s/blob/master/screens/dash-nodes.png)\n\n## Addons Included\n\n### [**Linode Cloud Controller Manager (CCM)**](https://github.com/linode/linode-cloud-controller-manager)\n\nA primary function of the CCM is to register and maintain Kubernetes `LoadBalancer` settings within a Linode [`NodeBalancer`](https://www.linode.com/nodebalancers).  This is needed to allow traffic from the Internet into the cluster in the most fault tollerant way (obviously very important!)\n\nThe CCM also annotates new Kubernetes Nodes with Linode specific details, including the LinodeID and instance type.  Linode hostnames and network addresses are automatically associated with their corresponding Kubernetes resources, forming the basis for a variety of Kubernetes features.\n\nThe CCM monitors the Linode API for changes in the Linode instance and will remove a Kubernetes Node if it finds the Linode has been deleted.  Resources will automatically be re-scheduled if the Linode is powered off.\n\n[Learn more about the CCM concept on kubernetes.io.](https://kubernetes.io/docs/concepts/architecture/cloud-controller/)  \n\n### [**Linode Container Storage Interface (CSI)**](https://github.com/linode/linode-blockstorage-csi-driver)\n\nThe CSI provides a Kubernetes `Storage Class` which can be used to create `Persistent Volumes` (PV) using [Linode Block Storage Volumes](https://www.linode.com/blockstorage).  Pods then create `Persistent Volume Claims` (PVC) to attach to these volumes.\n\nWhen a `PV` is deleted, the Linode Block Storage Volume will be deleted as well, based on the `ReclaimPolicy`.\n\nIn this Terraform Module, the `DefaultStorageClass` is provided by the `Linode CSI`.  Persistent volumes can be defined with an alternate  `storageClass`.\n\n[Learn More about Persistent Volumes on kubernetes.io.](https://kubernetes.io/docs/concepts/storage/persistent-volumes/)\n\n### [**External-DNS support for Linode**](https://github.com/kubernetes-incubator/external-dns/blob/master/docs/tutorials/linode.md)\n\nUnlike [CoreDNS](https://kubernetes.io/docs/tasks/administer-cluster/dns-custom-nameservers/) (or KubeDNS), which provides DNS services within the Kubernetes cluster, [External-DNS](https://github.com/kubernetes-incubator/external-dns/blob/master/README.md) publishes the public facing IP addresses associated with exposed services to a public DNS server, such as the [Linode DNS Manager](https://www.linode.com/dns-manager).\n\nAs configured in this Terraform module, any service or ingress with a specific annotation, will have a DNS record managed for it, pointing to the appropriate Linode or NodeBalancer IP address.  The domain must already be configured in the [Linode DNS Manager](https://www.linode.com/docs/platform/manager/dns-manager/#domain-zones).\n\n[Learn more at the External-DNS Github project.](https://github.com/kubernetes-incubator/external-dns)\n\n## Development\n\nTo make changes to this project, verify that you have the prerequisites and then clone the repo.  Instead of using the Terraform `module` syntax, and being confined by the variables that are provided, you'll be able to make any changes necessary.\n\n```bash\ngit clone https://github.com/linode/terraform-linode-k8s.git\ncd terraform-linode-k8s\n```\n\nOr if you won't be submitting changes, you can use `terraform init`:\n\n```bash\nterraform init --from-module=linode/k8s/linode linode-k8s\n```\n\n### Modules\n\nThis terraform modules is composed of three sub-modules for reuse and separation of concerns.\n\n* Instance - Provisions a base Linode Instance for the cluster.\n* Master - Uses the Instance module as a base and futher provisions a Kubernetes control-plane.\n* Node - Uses the Instance module as a base and further provisions a Kubernetes worker joined to a control-plane using module parameters.\n\n### Contribution Guidelines\n\nWould you like to improve the `terraform-linode-k8s` module? Please start [here](https://github.com/linode/terraform-linode-k8s/blob/master/.github/CONTRIBUTING.md).\n\n### Join us on Slack\n\nFor general help or discussion, join the [Kubernetes Slack](http://slack.k8s.io/) channel [#linode](https://kubernetes.slack.com/messages/CD4B15LUR).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinode%2Fterraform-linode-k8s","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinode%2Fterraform-linode-k8s","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinode%2Fterraform-linode-k8s/lists"}