Terraform module for creating K3S cluster using Hetzner cloud services.
module "infrastructure" {
source = "github.com/dmalykh/hetzner_k3s"
hcloud_token = "${var.hcloud_token}"
os = "ubuntu-22.04"
location = "hel1"
ssh_key = {
public_key = "${var.public_key}"
private_key = file("${var.private_key}")
}
master = {
count = 3
server_type = "cx21"
}
agent = {
count = 6
server_type = "cx11"
}
}
resource "local_sensitive_file" "kubeconfig_file" {
content = module.infrastructure.kube_config
filename = "./.kubeconfig"
}
Name | Version |
---|---|
hcloud | 1.35.2 |
Name | Version |
---|---|
hcloud | 1.35.2 |
kubernetes | n/a |
template | n/a |
Name | Source | Version |
---|---|---|
k3s | [email protected]:dmalykh/terraform-module-k3s.git | n/a |
Name | Type |
---|---|
hcloud_network.private | resource |
hcloud_network_subnet.private_subnet | resource |
hcloud_server.agent | resource |
hcloud_server.master | resource |
hcloud_server_network.agent | resource |
hcloud_server_network.master | resource |
hcloud_ssh_key.default | resource |
kubernetes_cluster_role_binding.boostrap | resource |
kubernetes_service_account.bootstrap | resource |
hcloud_image.os | data source |
kubernetes_secret.sa_credentials | data source |
template_file.init | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
agent | Agent nodes | object({ |
n/a | yes |
cidr | K3s network CIDRs (see https://rancher.com/docs/k3s/latest/en/installation/install-options/). | object({ |
{ |
no |
cloud-init | n/a | string |
"" |
no |
hcloud_token | n/a | string |
n/a | yes |
ipadd | Add to IP addresses sequesce to avoid zero-ip defenition | number |
1 |
no |
location | n/a | string |
"hel1" |
no |
master | Control plane nodes | object({ |
n/a | yes |
networking | n/a | object({ |
{} |
no |
os | Operating system that will be installed on a server | string |
"ubuntu-22.04" |
no |
ssh_key | n/a | object({ |
n/a | yes |
Name | Description |
---|---|
bootstrap_sa | Bootstrap ServiceAccount. Can be used by Terraform to provision this cluster. |
kube_config | n/a |
summary | Output |