k3s
BerndDA/k3s/hcloud
Terraform module to setup k3s cluster on Hetzner cloud
terraform-hcloud-k3s Terraform module to setup k3s cluster on Hetzner cloud Heavily inspired by: https://github.com/vitobotta/hetzner-k3s Thanks a lot! Prerequisites - generate a ssh keypair (id_ssh) and place it in the root directory of your terraform - ssh-keygen -f ./id_ssh Resources created in Hetzner Cloud - Main nodes (controlplane) like defined in main_pool_config - Woker nodes like defined in worker_pool_config - Private network & subnet - Loadblancer for kubernetes API access - Firewall for all nodes Installed inside Cluster - Hetzner CSI - https://github.com/hetznercloud/csi-driver - Hetzner CCM - https://github.com/hetznercloud/hcloud-cloud-controller-manager - K3S Rancher System Upgrade Controller - https://rancher.com/docs/k3s/latest/en/upgrades/automated/ Remarks - Nodes use
| Name | Type | Description | Default |
|---|---|---|---|
| hetzner_token | string | Hetzner cloud API token | required |
| ssh_private_key | string | required | |
| ssh_public_key | string | required | |
| worker_pool_config | object({ num_nodes = numbe | Number and type of worker nodes | {
"node_type": "cx21",
"num_nodes": |
| cluster_name | string | Name of your cluster. Also used to pre/postfix resources | "dev" |
| image | string | Type of OS image used for all nodes | "debian-11" |
| k3s_version | string | K3S version to install on the nodes | "v1.24.1+k3s1" |
| location | string | Location of all resources within Hetzner Cloud (fsn1|nbg1|hel1|ash) | "nbg1" |
| ssh_file | string | File and Path to ssh key. If you want to create multiple clusters in the same pr | "./id_ssh" |
| main_pool_config | object({ num_nodes = numbe | Number and type of main nodes | {
"node_type": "cx11",
"num_nodes": |
| kubeconfig_file | string | File and Path of kubeconfig file to write | "./kube_config.yml" |
k3s_token — the secret k3s tokenapi_loadbalancer_ip — the IP of the API loadbalancer