2022-04-13 17:29:03 +02:00
# Only the first values starting with a * are obligatory; the rest can remain with their default values, or you
2022-03-02 22:32:34 +01:00
# could adapt them to your needs.
2022-03-02 20:54:29 +01:00
#
2022-04-13 17:29:03 +02:00
# Note that some values, notably "location" and "public_key" have no effect after initializing the cluster.
# This is to keep Terraform from re-provisioning all nodes at once, which would lose data. If you want to update
# those, you should instead change the value here and manually re-provision each node. Grep for "lifecycle".
2022-03-02 20:54:29 +01:00
2022-03-11 12:17:48 +01:00
# * Your Hetzner project API token
2022-01-06 07:16:18 +01:00
hcloud_token = "xxxxxxxxxxxxxxxxxxYYYYYYYYYYYYYYYYYYYzzzzzzzzzzzzzzzzzzzzz"
2022-03-02 22:32:34 +01:00
# * Your public key
2022-01-06 07:16:18 +01:00
public_key = "/home/username/.ssh/id_ed25519.pub"
2022-04-13 17:29:03 +02:00
# * Your private key must be "private_key = null" when you want to use ssh-agent for a Yubikey-like device authentification or an SSH key-pair with a passphrase.
2022-04-13 17:45:29 +02:00
# For more details on SSH see https://github.com/kube-hetzner/kube-hetzner/blob/master/docs/ssh.md
2022-01-06 07:16:18 +01:00
private_key = "/home/username/.ssh/id_ed25519"
# These can be customized, or left with the default values
2022-04-13 17:45:29 +02:00
# * For Hetzner locations see https://docs.hetzner.com/general/others/data-centers-and-connection/
2022-02-25 19:16:38 +01:00
network_region = "eu-central" # change to `us-east` if location is ash
2022-02-27 10:51:41 +01:00
2022-04-13 17:29:03 +02:00
# For the control planes, at least three nodes are the minimum for HA. Otherwise, you need to turn off the automatic upgrade (see ReadMe).
# As per rancher docs, it must always be an odd number, never even! See https://rancher.com/docs/k3s/latest/en/installation/ha-embedded/
# For instance, one is ok (non-HA), two is not ok, and three is ok (becomes HA). It does not matter if they are in the same nodepool or not! So they can be in different locations and of various types.
2022-02-28 14:27:24 +01:00
2022-04-13 17:29:03 +02:00
# Of course, you can choose any number of nodepools you want, with the location you want. The only constraint on the location is that you need to stay in the same network region, Europe, or the US.
# For the server type, the minimum instance supported is cpx11 (just a few cents more than cx11); see https://www.hetzner.com/cloud.
2022-04-12 15:23:59 +02:00
2022-04-13 17:29:03 +02:00
# IMPORTANT: Before you create your cluster, you can do anything you want with the nodepools, but you need at least one of each control plane and agent.
# Once the cluster is up and running, you can change nodepool count and even set it to 0 (in the case of the first control-plane nodepool, the minimum is 1),
# you can also rename it (if the count is 0), but do not remove a nodepool from the list.
2022-04-13 14:14:22 +02:00
2022-04-13 17:29:03 +02:00
# The only nodepools that are safe to remove from the list when you edit it are at the end of the lists. That is due to how subnets and IPs get allocated (FILO).
# You can, however, freely add other nodepools at the end of each list if you want! The maximum number of nodepools you can create combined for both lists is 255.
# Also, before decreasing the count of any nodepools to 0, it's essential to drain and cordon the nodes in question. Otherwise, it will leave your cluster in a bad state.
2022-04-12 15:37:50 +02:00
2022-04-13 17:29:03 +02:00
# Before initializing the cluster, you can change all parameters and add or remove any nodepools. You need at least one nodepool of each kind, control plane, and agent.
2022-04-14 13:59:05 +02:00
# The nodepool names are entirely arbitrary, you can choose whatever you want, but no special characters or underscore, and they must be unique; only alphanumeric characters and dashes are allowed.
2022-04-12 17:35:09 +02:00
2022-04-13 17:29:03 +02:00
# If you want to have a single node cluster, have one control plane nodepools with a count of 1, and one agent nodepool with a count of 0.
2022-04-12 15:37:50 +02:00
2022-04-13 17:45:29 +02:00
# * Example below:
2022-04-12 15:37:50 +02:00
2022-04-09 08:40:36 +02:00
control_plane_nodepools = [
{
name = "control-plane-fsn1",
server_type = "cpx11",
location = "fsn1",
labels = [],
taints = [],
2022-04-13 14:14:22 +02:00
count = 1
2022-04-09 08:40:36 +02:00
},
{
name = "control-plane-nbg1",
server_type = "cpx11",
location = "nbg1",
labels = [],
taints = [],
count = 1
2022-04-13 14:14:22 +02:00
},
{
name = "control-plane-hel1",
server_type = "cpx11",
location = "hel1",
labels = [],
taints = [],
count = 1
2022-04-09 08:40:36 +02:00
}
]
2022-02-28 10:56:40 +01:00
2022-03-09 03:15:15 +01:00
agent_nodepools = [
{
name = "agent-small",
2022-02-27 21:48:33 +01:00
server_type = "cpx11",
2022-04-04 21:06:08 +02:00
location = "fsn1",
labels = [],
taints = [],
2022-04-12 17:35:09 +02:00
count = 1
2022-03-09 03:15:15 +01:00
},
{
name = "agent-large",
server_type = "cpx21",
2022-04-09 08:40:36 +02:00
location = "nbg1",
2022-04-04 21:06:08 +02:00
labels = [],
taints = [],
2022-03-09 03:15:15 +01:00
count = 1
2022-04-04 21:06:08 +02:00
},
{
name = "storage",
server_type = "cpx21",
location = "fsn1",
2022-04-09 08:40:36 +02:00
labels = [
2022-04-04 21:06:08 +02:00
"node.kubernetes.io/server-usage=storage"
],
2022-04-09 08:40:36 +02:00
taints = [
2022-04-04 21:06:08 +02:00
"server-usage=storage:NoSchedule"
],
2022-04-09 08:40:36 +02:00
count = 1
2022-02-23 16:46:46 +01:00
}
2022-03-09 03:15:15 +01:00
]
2022-01-13 22:41:36 +01:00
2022-04-13 17:45:29 +02:00
# * LB location and type, the latter will depend on how much load you want it to handle, see https://www.hetzner.com/cloud/load-balancer
2022-04-09 08:40:36 +02:00
load_balancer_type = "lb11"
load_balancer_location = "fsn1"
2022-02-28 14:27:24 +01:00
2022-04-13 17:29:03 +02:00
### The following values are entirely optional
2022-03-02 22:32:34 +01:00
2022-04-13 17:29:03 +02:00
# If you want to use a specific Hetzner CCM and CSI version, set them below; otherwise, leave them as-is for the latest versions
2022-01-13 22:41:36 +01:00
# hetzner_ccm_version = ""
2022-01-15 09:04:21 +01:00
# hetzner_csi_version = ""
2022-03-14 10:45:11 +01:00
2022-04-14 13:59:05 +02:00
# We give you the possibility to use letsencrypt directly with Traefik because it's an easy setup, however it's not optimal,
# as the free version of Traefik causes a little bit of downtime when when the certificates get renewed. For proper SSL management,
# we instead recommend you to use cert-manager, that you can easily deploy with helm; see https://cert-manager.io/.
2022-02-01 23:32:10 +01:00
# traefik_acme_tls = true
# traefik_acme_email = "mail@example.com"
2022-02-07 16:09:46 +01:00
2022-04-14 13:59:05 +02:00
# If you want to disable the Traefik ingress controller, you can can set this to "false". Default is "true".
2022-03-14 10:45:11 +01:00
# traefik_enabled = false
2022-04-13 17:29:03 +02:00
# If you want to disable the metric server, you can! Default is "true".
2022-03-21 21:29:41 +01:00
# metrics_server_enabled = false
2022-03-11 12:17:48 +01:00
2022-04-13 17:29:03 +02:00
# If you want to allow non-control-plane workloads to run on the control-plane nodes, set "true" below. The default is "false".
2022-04-12 17:35:09 +02:00
# True by default for single node clusters.
2022-02-07 16:09:46 +01:00
# allow_scheduling_on_control_plane = true
2022-02-16 03:18:40 +01:00
2022-04-13 17:29:03 +02:00
# If you want to disable the automatic upgrade of k3s, you can set this to false. The default is "true".
2022-02-16 03:18:40 +01:00
# automatically_upgrade_k3s = false
2022-02-23 21:35:42 +01:00
# Allows you to specify either stable, latest, or testing (defaults to stable), see https://rancher.com/docs/k3s/latest/en/upgrades/basic/
# initial_k3s_channel = "latest"
2022-02-27 23:15:46 +01:00
2022-03-09 05:19:06 +01:00
# The cluster name, by default "k3s"
# cluster_name = ""
2022-03-05 05:33:29 +01:00
2022-04-13 17:29:03 +02:00
# Whether to use the cluster name in the node name, in the form of {cluster_name}-{nodepool_name}, the default is "true".
2022-03-09 09:44:16 +01:00
# use_cluster_name_in_node_name = false
2022-02-27 23:15:46 +01:00
# Adding extra firewall rules, like opening a port
2022-04-13 17:29:03 +02:00
# In this example, we allow port TCP 5432 for a Postgres service that we will open via a node port and also allow outgoing SMTP traffic on port TCP 465
2022-02-27 23:15:46 +01:00
# More info on the format here https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs/resources/firewall
2022-02-27 23:30:56 +01:00
# extra_firewall_rules = [
# {
# direction = "in"
# protocol = "tcp"
# port = "5432"
# source_ips = [
# "0.0.0.0/0"
# ]
# },
2022-04-04 21:06:08 +02:00
# {
# direction = "out"
# protocol = "tcp"
# port = "465"
# destination_ips = [
# "0.0.0.0/0"
# ]
# },
2022-02-27 23:30:56 +01:00
# ]
2022-03-04 15:02:54 +01:00
# If you want to configure additional Arguments for traefik, enter them here as a list and in the form of traefik CLI arguments; see https://doc.traefik.io/traefik/reference/static-configuration/cli/
2022-03-05 10:59:20 +01:00
# Example: traefik_additional_options = ["--log.level=DEBUG", "--tracing=true"]
# traefik_additional_options = []
2022-04-02 22:45:41 +02:00
# If you want to configure a different CNI for k3s, use this flag
# possible values: flannel (Default), calico
2022-04-14 13:59:05 +02:00
# Cilium or other would be easy to add, you can mirror how Calico was added. PRs are welcome!
# CAVEATS: Calico is not supported for single node setups, because of the following issue https://github.com/k3s-io/klipper-lb/issues/6.
2022-04-13 15:59:03 +02:00
# cni_plugin = "calico"
2022-04-09 19:20:20 +02:00
# If you want to disable the k3s default network policy controller, use this flag
# Calico overrides this value to true automatically
2022-04-14 14:17:27 +02:00
# disable_network_policy = true
2022-04-13 14:33:33 +02:00
2022-04-13 09:29:29 +02:00
# If you want to disable the automatic use of placement group "spread". See https://docs.hetzner.com/cloud/placement-groups/overview/
# That may be useful if you need to deploy more than 500 nodes! The default is "false".
2022-04-13 14:33:33 +02:00
# placement_group_disable = true