Kubernetes cluster provisioning using Terraform.
Alternatives To Provisioning
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Devops Exercises43,460
2 days ago14otherPython
Linux, Jenkins, AWS, SRE, Prometheus, Docker, Python, Ansible, Git, Kubernetes, Terraform, OpenStack, SQL, NoSQL, Azure, GCP, DNS, Elastic, Network, Virtualization. DevOps Interview Questions
9 days ago1May 10, 20225otherShell
I am using this repository to document my journey learning about DevOps. I began this process on January 1, 2022, and plan to continue until March 31. I will be dedicating one hour each day, including weekends, to gaining a foundational understanding of the various aspects of DevOps. This will be a 90-day intensive study period. 2022 & 2023 inc.
Microservices Demo14,201
2 days ago43August 04, 202238apache-2.0Python
Sample cloud-first application with 10 microservices showcasing Kubernetes, Istio, and gRPC.
Terraformer10,25312 days ago20November 15, 202167apache-2.0Go
CLI tool to generate terraform files from existing infrastructure (reverse Terraform). Infrastructure to Code
a day ago19gpl-3.0Go
Modern self-hosting framework, fully automated from empty disk to operating services with a single command.
Docker Android5,714
8 days ago80otherPython
Android in docker solution with noVNC supported and video recording
Checkov5,6024a day ago2,207July 07, 2022153apache-2.0Python
Prevent cloud misconfigurations and find vulnerabilities during build-time in infrastructure as code, container images and open source packages with Checkov by Bridgecrew.
4 months ago10mit
Kubernetes clusters for the hobbyist.
Steampipe5,2713a day ago352September 20, 2022253agpl-3.0Go
Use SQL to instantly query your cloud services (AWS, Azure, GCP and more). Open source CLI. No DB required.
a month ago37apache-2.0Go
KubeOperator 是一个开源的轻量级 Kubernetes 发行版,专注于帮助企业规划、部署和运营生产级别的 K8s 集群。
Alternatives To Provisioning
Select To Compare

Alternative Project Comparisons

Kubernetes cluster setup automation

This is part of the Hobby Kube project. Functionality of the modules is described in the guide.

Deploy a secure Kubernetes cluster on Hetzner Cloud, Scaleway, DigitalOcean or Packet using Terraform.



The following packages are required to be installed locally:

brew install terraform kubectl jq wireguard-tools

Modules are using ssh-agent for remote operations. Add your SSH key with ssh-add -K if Terraform repeatedly fails to connect to remote hosts.


Important: Modify only in project root, comment or uncomment sections as needed. All variables in can be set either directly or from environment variable.

Export the following environment variables depending on the modules you're using:

Set number of hosts (nodes)

export TF_VAR_node_count=3

Set number of etcd members

The first N nodes will be part of the etcd cluster. 3 or 5 are good values, see here.

export TF_VAR_etcd_node_count=3

Using Hetzner Cloud as provider

export TF_VAR_hcloud_token=<token>
export TF_VAR_hcloud_ssh_keys=<keys>
export TF_VAR_hcloud_ssh_keys='["<description-key1>", "<description-key2>"]'
# Defaults:
# export TF_VAR_hcloud_location="nbg1"
# export TF_VAR_hcloud_type="cx11"
# export TF_VAR_hcloud_image="ubuntu-22.04"

SSH keys are referenced by their description. Visit the Hetzner Cloud console at<project-id>/access/sshkeys

Using Scaleway as provider

export TF_VAR_scaleway_organization_id=<organization_id>
export TF_VAR_scaleway_access_key=<access_key> # can be omitted for now
export TF_VAR_scaleway_secret_key=<secret_key>
# Defaults:
# export TF_VAR_scaleway_zone="nl-ams-1"
# export TF_VAR_scaleway_type="DEV1-S"
# export TF_VAR_scaleway_image="Ubuntu 22.04 Jammy Jellyfish"

Using DigitalOcean as provider

export TF_VAR_digitalocean_token=<token>
export TF_VAR_digitalocean_ssh_keys=<keys>
export TF_VAR_digitalocean_ssh_keys='["<id-key1>", "<id-key2>"]'
# Defaults:
# export TF_VAR_digitalocean_region="fra1"
# export TF_VAR_digitalocean_size="1gb"
# export TF_VAR_digitalocean_image="ubuntu-22-04-x64"

You can get SSH key IDs using this API.

Using Packet as provider

export TF_VAR_packet_auth_token=<token>
export TF_VAR_packet_project_id=<uuid>
# Defaults:
# export TF_VAR_packet_facility="sjc1"
# export TF_VAR_packet_plan="c1.small.x86"
# export TF_VAR_packet_operating_system="ubuntu_22_04"

Using vSphere as provider

export TF_VAR_vsphere_server=<FQDN or IP of vCenter Server>
export TF_VAR_vsphere_datacenter=<vSphere Datacenter Name>
export TF_VAR_vsphere_cluster=<vSphere Cluster Name>
export TF_VAR_vsphere_network=<vSphere Network Name>
export TF_VAR_vsphere_datastore=<vSphere Datastore Name>
export TF_VAR_vsphere_vm_template=<vSphere VM Template Name>
export TF_VAR_vsphere_user=<vSphere Admin Username>
export TF_VAR_vsphere_password=<vSphere Admin Password>
# Defaults:
# export TF_VAR_vsphere_vm_linked_clone=false
# export TF_VAR_vsphere_vm_num_cpus="2"
# export TF_VAR_vsphere_vm_memory="2048"

Template VM needs to pre-configured so that root can login using SSH key.

Using UpCloud as provider

export TF_VAR_upcloud_username=<UpCloud API account username>
export TF_VAR_upcloud_password=<UpCloud API account password>
export TF_VAR_upcloud_ssh_keys='["<PUBLIC KEY HERE>"]'
# Defaults:
# export TF_VAR_upcloud_zone="de-fra1"
# export TF_VAR_upcloud_plan="1xCPU-2GB"
# export TF_VAR_upcloud_disk_template="Ubuntu Server 22.04 LTS (Jammy Jellyfish)"

You will need API credentials to use the UpCloud terraform provider, see for more info.

Using Cloudflare for DNS entries

export TF_VAR_domain=<domain> # e.g.
export TF_VAR_cloudflare_email=<email>
export TF_VAR_cloudflare_api_token=<token>

Using Amazon Route 53 for DNS entries

export TF_VAR_domain=<domain> # e.g. shall be already added to hosted zones.
export TF_VAR_aws_access_key=<ACCESS_KEY>
export TF_VAR_aws_secret_key=<SECRET_KEY>
export TF_VAR_aws_region=<region> # e.g. eu-west-1

Install additional APT packages

Each provider takes an optional variable to install further packages during provisioning:

module "provider" {
  # ...
  apt_packages = ["ceph-common", "nfs-common"]

Add more firewall rules

Security/ufw takes an optional variable to add custom firewall rules during provisioning:

module "firewall" {
  # ...
  additional_rules = ["allow 1194/udp", "allow ftp"]


From the root of this project...

# fetch the required modules
$ terraform init

# see what `terraform apply` will do
$ terraform plan

# execute it
$ terraform apply

Using modules independently

Modules in this repository can be used independently:

module "kubernetes" {
  source = ""

  # Or to pin a certain commit
  # source = "git::"

After adding this to your plan, run terraform get to fetch the module.

Popular Terraform Projects
Popular Kubernetes Projects
Popular Configuration Management Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.