this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Added basic infrastructure

+1563
+2
.envrc
··· 1 + export TF_VAR_hcloud_token=$(cat ./envs/TF_VAR_hcloud_token) 2 + export KUBECONFIG=./tub_kubeconfig.yaml
+11
.gitattributes
··· 1 + # git-crypt configuration 2 + # See: https://github.com/AGWA/git-crypt 3 + 4 + # Encrypt environment variables and tokens 5 + envs/TF_VAR_hcloud_token filter=git-crypt diff=git-crypt 6 + 7 + # Encrypt SSH keys 8 + keypair/** filter=git-crypt diff=git-crypt 9 + 10 + # Encrypt Kubeconfig files 11 + *kubeconfig.yaml filter=git-crypt diff=git-crypt
+33
.gitignore
··· 1 + # Local .terraform directories 2 + **/.terraform/* 3 + 4 + # .tfstate files 5 + *.tfstate 6 + *.tfstate.* 7 + 8 + # Crash log files 9 + crash.log 10 + crash.*.log 11 + 12 + # Exclude all .tfvars files, which are likely to contain sensitive data, such as 13 + # password, private keys, and other secrets. These should not be part of version 14 + # control as they are data-based configuration files and not code. 15 + *.tfvars 16 + *.tfvars.json 17 + 18 + # Ignore override files as they are usually used to override resources locally and so 19 + # are not considered part of the primary codebase 20 + override.tf 21 + override.tf.json 22 + *_override.tf 23 + *_override.tf.json 24 + 25 + # Include override files you do want to forestall terraform from ignoring 26 + # !example_override.tf 27 + 28 + # Include lock file if you want to lock the providers 29 + # !.terraform.lock.hcl 30 + 31 + # Backup files 32 + *.yaml.backup 33 + k3s_kustomization_backup.yaml
+195
.terraform.lock.hcl
··· 1 + # This file is maintained automatically by "tofu init". 2 + # Manual edits may be lost in future updates. 3 + 4 + provider "registry.opentofu.org/anapsix/semvers" { 5 + version = "0.7.1" 6 + constraints = ">= 0.7.1" 7 + hashes = [ 8 + "h1:09vjjzMD/AvFBxn9NdP5iN+7jmm21nm2NN/Gk9zcB+E=", 9 + "zh:049fa2bc555b1264427296c55462c24151aedd251ec32673e7775c451c5b0339", 10 + "zh:18d72a3d0e3e502ea68e477396651922e59d97ddaeda132004ca6bc8e13334ed", 11 + "zh:20cacd13b826250ce29e19691492e958db95fd8e66163bb6402050f791f82c93", 12 + "zh:3d13be2d81197f66e69d544c7b708184a4f0341b3fd413a76ec7ff37dbd67999", 13 + "zh:408012764fab3b5d79751ff1c3413dc17ff02a0b1e64655e131218b5a2c970da", 14 + "zh:416c589984585c19952e75866a08a7299c9a2eeb81b015302962bbe09004484a", 15 + "zh:4227a3dcac531608b6b89a2db5f40e99def6864c24b5e8f3e04c15290e2233dd", 16 + "zh:6c1f4226a2fa7ee74c87974f0b5b1420668541d614a958744e17090ea0e6476e", 17 + "zh:90c381aab648cd7507e93725c2bed847c91d2b186eaff09193adec771e689a5c", 18 + "zh:9aa5755bdadff19265f3a434fcadc4a04cd622a40bac7381b5a6ac74b4d5fe8f", 19 + "zh:ac6b01165bc361ddff7d3392311ea494aa6af2d089ab0b43b48f24ac949612ae", 20 + "zh:ba589c0dfa18929244578f02c2d9f4a4c32c79cb57cd9c3ad7e8cbe123cc98fa", 21 + "zh:bc0f3ff5b24e1d2ccf8e1e85fb0f931fd58e1ddaac4abe6b07f94844a1425cd1", 22 + "zh:ced293727d8d91f7ddf85d07c897d23c0a3188251d1065dea5a65342637c5853", 23 + "zh:d3f92af0ee440a540826a61a7b07f30d0155ddc40d70484d1c68c5abdbdabed2", 24 + "zh:d4736f830f2913ba018868fe888a267441b33d1ecb8275ce941fb60150dd60f3", 25 + "zh:df202a4bf895a3a60fdcd39a55296c95e44d3ce300cf6ce3e3e12744c24a941c", 26 + "zh:ec198fa89c5039e3a41dfe0a704e9428389a2f663a69dc438136945887cc6711", 27 + "zh:f809ab383cca0a5f83072981c64208cbd7fa67e986a86ee02dd2c82333221e32", 28 + "zh:fe0d8d1bbe515d52b04b01cb93f3cdd25fb3f74833d5e62b3a7ea40ea8f229bf", 29 + ] 30 + } 31 + 32 + provider "registry.opentofu.org/hashicorp/assert" { 33 + version = "0.16.0" 34 + constraints = ">= 0.16.0" 35 + hashes = [ 36 + "h1:RWFbUJV5nh75/yqobhnzgBg/GetGImCvGwmnPJF37b4=", 37 + "zh:3c04d08d1bb4ae810b7972a219c8dd42a8ab901a9bc25197b250c38f3fa57033", 38 + "zh:46119bcc47b545809c0ee873a72d44f4f875cca4d7228605f5c7a8956a5e7d55", 39 + "zh:511949ee8a6ac8ff7296b4c9778deb2aec2783f5b85c4f27382a3b623fc50a4a", 40 + "zh:b4ebb8b832bae26443880d2e17493f754495db2d6c3f02c6d0070cbf5ae21598", 41 + "zh:bebed6c1873871eb824103f08e72055c077f01b10a40944760d19ffdd721d9ab", 42 + "zh:e412855fd2fd81e0a847e45308bdbac99995315c503fdddf262ee59e1b7c5263", 43 + "zh:ed47c4fe28c6f148f11fa4098516abea008c49fa670c3cedd2ff94596cac0831", 44 + "zh:edee914b1d12ac6db241a1fecaa5186c47f361f4ceb2deb23ad45d67bf95c7b1", 45 + "zh:eff5b2e1c2128217bdbc600eda4fe011831e5c655bf4acd84b6495fc20d128d3", 46 + "zh:ff64424784171a3361b1ea95d8cef334ec1c4a395812edd0a77a1ed6b4119b0f", 47 + ] 48 + } 49 + 50 + provider "registry.opentofu.org/hashicorp/cloudinit" { 51 + version = "2.3.7" 52 + hashes = [ 53 + "h1:El6cBCCiCPGwJsSSN0Z+EUWatjI45hie+kIDnTegV9A=", 54 + "zh:2d48b8452eae9bac2e62273e8f535f73694d8cb05ea38f4b27ee735dcc38eed4", 55 + "zh:4add11b87e48d0e6ecd19243a06ecfc42fc07d0a3748fe568c2971d5f4767486", 56 + "zh:4c9c4e3319cf3328595ea2d68eba7c604325fbcba38cd443e39e982b0b4e29f2", 57 + "zh:503dd83a05b0421ecbcb140d5fdbe3a6b82f163495a82587a1390cf66d7a27be", 58 + "zh:7dd34de7e68036dbbb70c249968a2a10bccba1cb92d3b4dccbc0eb65a3fc58ea", 59 + "zh:a4d7b4480d38446b8da96ce4ecbc2e5a081c4ddc3da2bad97d7b228821b77895", 60 + "zh:bdec6329c3d2d5f034080d9cd6f9a15a2c052faacd716f981e247b48e6845c01", 61 + "zh:e1519544ae3f67196d144e18c21ad681dc29da3133a537ffdd5c2c6271b8db0c", 62 + "zh:e58cd6b05ed51a6fa072e5de2208ba36a58557c3fb414d50c42b3d40a11366b7", 63 + "zh:fafc4a49c297516f2a40490f9a7e6d2b437d77a94330797d4eead178c987ccb5", 64 + ] 65 + } 66 + 67 + provider "registry.opentofu.org/hashicorp/local" { 68 + version = "2.6.2" 69 + constraints = ">= 2.5.2" 70 + hashes = [ 71 + "h1:9PxkbqNiMxveZTy0xmqyFWjlC268pgAnxj9QsV1jKGk=", 72 + "zh:157db8450c465fa31b2ede8e9afa13df81eb9c61c7434198865215286c797fba", 73 + "zh:4455f76d312fc3dc736a0b288d8027ce57aab87696a8d05dcde0018e38483a7e", 74 + "zh:47f9e66c9576c6d7af9ca816202bf0bbca1c8dc138ff09453b1e1cd785bb747b", 75 + "zh:5c960ccc2330c257869531498baba2c0c357d443ffde98b705b894cf88ff1c19", 76 + "zh:667ac9e1cd1cd43b5cdc41010e9809e115e936a35c33e869531b53c785bf7955", 77 + "zh:8bb47bc8c47861f35b5297b98aa746d411433211e563716dd084e65b28a175e6", 78 + "zh:b55b3e8bc6222a860f109d292f25eca401edebd440471e147a46654828d343e6", 79 + "zh:cfe98287581970caad2a10168e4f11115ab3064d93d681044aca39dbac47cae2", 80 + "zh:e0d8f6e0b7815be1895fe10b821cf1a87e2ffe44524704f65e002def1d8e6038", 81 + ] 82 + } 83 + 84 + provider "registry.opentofu.org/hashicorp/null" { 85 + version = "3.2.4" 86 + hashes = [ 87 + "h1:i+WKhUHL2REY5EGmiHjfUljJB8UKZ9QdhdM5uTeUhC4=", 88 + "zh:1769783386610bed8bb1e861a119fe25058be41895e3996d9216dd6bb8a7aee3", 89 + "zh:32c62a9387ad0b861b5262b41c5e9ed6e940eda729c2a0e58100e6629af27ddb", 90 + "zh:339bf8c2f9733fce068eb6d5612701144c752425cebeafab36563a16be460fb2", 91 + "zh:36731f23343aee12a7e078067a98644c0126714c4fe9ac930eecb0f2361788c4", 92 + "zh:3d106c7e32a929e2843f732625a582e562ff09120021e510a51a6f5d01175b8d", 93 + "zh:74bcb3567708171ad83b234b92c9d63ab441ef882b770b0210c2b14fdbe3b1b6", 94 + "zh:90b55bdbffa35df9204282251059e62c178b0ac7035958b93a647839643c0072", 95 + "zh:ae24c0e5adc692b8f94cb23a000f91a316070fdc19418578dcf2134ff57cf447", 96 + "zh:b5c10d4ad860c4c21273203d1de6d2f0286845edf1c64319fa2362df526b5f58", 97 + "zh:e05bbd88e82e1d6234988c85db62fd66f11502645838fff594a2ec25352ecd80", 98 + ] 99 + } 100 + 101 + provider "registry.opentofu.org/hashicorp/random" { 102 + version = "3.8.1" 103 + hashes = [ 104 + "h1:LsYuJLZcYl1RiH7Hd3w90Ra5+k5cNqfdRUQXItkTI8Y=", 105 + "zh:25c458c7c676f15705e872202dad7dcd0982e4a48e7ea1800afa5fc64e77f4c8", 106 + "zh:2edeaf6f1b20435b2f81855ad98a2e70956d473be9e52a5fdf57ccd0098ba476", 107 + "zh:44becb9d5f75d55e36dfed0c5beabaf4c92e0a2bc61a3814d698271c646d48e7", 108 + "zh:7699032612c3b16cc69928add8973de47b10ce81b1141f30644a0e8a895b5cd3", 109 + "zh:86d07aa98d17703de9fbf402c89590dc1e01dbe5671dd6bc5e487eb8fe87eee0", 110 + "zh:8c411c77b8390a49a8a1bc9f176529e6b32369dd33a723606c8533e5ca4d68c1", 111 + "zh:a5ecc8255a612652a56b28149994985e2c4dc046e5d34d416d47fa7767f5c28f", 112 + "zh:aea3fe1a5669b932eda9c5c72e5f327db8da707fe514aaca0d0ef60cb24892f9", 113 + "zh:f56e26e6977f755d7ae56fa6320af96ecf4bb09580d47cb481efbf27f1c5afff", 114 + ] 115 + } 116 + 117 + provider "registry.opentofu.org/hetznercloud/hcloud" { 118 + version = "1.60.0" 119 + constraints = ">= 1.51.0" 120 + hashes = [ 121 + "h1:a+0jnJt73mpSsncc36Idxy5ziS7N4Iim4otcW11XkXo=", 122 + "zh:13d729f4859bdcf9e6c2e706bdb010d1e770d8e06834335a1ef7f982fffd0c99", 123 + "zh:3b36a77cf1869a9abce3a45e2c796cb4f3e5e819497919a8a837badbb9576a1d", 124 + "zh:4ec1f0d4e7fe4dffd7a4a2c5846d45243b1ade669c234a772631824c1d4faa10", 125 + "zh:5042482e86618efd1122e398faf09ccdf2ba849b0aefa589b6da656b847402d5", 126 + "zh:52d4524bdde5424cf2a8b130ab085c1236c694da16adae9d31c925c26bbde02d", 127 + "zh:54af898bdbbb0e342b9a2bf39725114cff52713a03ee966bd734a6a2fef953b9", 128 + "zh:59979a5377245ffd5c962123547703bca9201a7019c6ef5ba9cf2e6119b4911d", 129 + "zh:6006e47336182ab68c18980d620d9dc4aab8bdb250744e4c9117d694bf01192a", 130 + "zh:8061ace3e91510afde141d3556be50b1b23b2578ec0626843641fea8dad3bcaf", 131 + "zh:c24f6fcf0ddbe5395c71ccbda2588196b00c0090017a84d7ae4b0132197dfcd2", 132 + "zh:ca9143d179a3815d49e61f70cc8a3340abac44e8f75259f1107520e407252923", 133 + "zh:d5ea79ba8b22db4cb6404334316a2c58a9b7b44e8eb2ddf7d62350d99c1831d5", 134 + "zh:eb15f600011e7822b526b137fc5e88db15a7ef7c826ebaa16fa6486cf1f1ce2a", 135 + ] 136 + } 137 + 138 + provider "registry.opentofu.org/integrations/github" { 139 + version = "6.10.2" 140 + constraints = ">= 6.4.0" 141 + hashes = [ 142 + "h1:FBpodFPW47rtbjMx2olf4qwXHwh42BX0Wwy7nfXdnQ8=", 143 + "zh:0276720213c19abb83faf6774697518dc1040fd37bc83eef86634f85d4781cae", 144 + "zh:19c6a9736a3d0264c9e0064ee66f7a957f2e35af2d2b7d4a2936d6d02ae122c4", 145 + "zh:3212c3c92b2ab16feb6d99c1d2b252fef255aeb709303a2428ea3af0677c30a1", 146 + "zh:472b40f129c4e7ad2308870972c584874e018723fc190dfebe2416c5a6e6580f", 147 + "zh:721d21615de5565b5ab0b1a6cf79f3bff2c95b26289c9175fcc75947a216774d", 148 + "zh:80e9128e4da85e7d146025425aefaf20e85b6187e37c91182a19814bbc949684", 149 + "zh:83a0573eceb8f211a4f8cb9d2a98ad47c04878369046a6fcb18636cb3cbc78f3", 150 + "zh:9df2be04ec201a0d3c9251776c7eab1a8773b9ae758ebb996000e6ec7a3d72aa", 151 + "zh:a4028674e02099b2c63c73bbb51c8bebf437a5cc4537f56107852abdc2d442e7", 152 + "zh:a55dfa5f6665c63daa72bc3b50a90f2c11113c05014b2a8ae7d7f29a9ad87251", 153 + "zh:aa9af998f01ec75876fcfc9a0b4390c8f9d41dc8365e015506e7b227a0b2f042", 154 + "zh:f35e64bf0448856e21a9ecc3e551d11afdae11d44a408f124c7283354d504209", 155 + "zh:f6079518e101494fe6e62588393c739c5448e6b8b3f277da3d9b04f2088b14fe", 156 + "zh:fbd1fee2c9df3aa19cf8851ce134dea6e45ea01cb85695c1726670c285797e25", 157 + "zh:fe5835aa672c7ff876c3d327b1e1641b8d69da2f61322bd8ef4a226e40947e0f", 158 + ] 159 + } 160 + 161 + provider "registry.opentofu.org/isometry/deepmerge" { 162 + version = "1.2.1" 163 + constraints = "~> 1.0" 164 + hashes = [ 165 + "h1:+GBRWyzNYKj47qmSBcV28lrIIgk3Gusj48maI+jrL0Q=", 166 + "zh:13be4c31971addc10e26a003e22b8867dba41737ffbc9de86ed84555c4a539b7", 167 + "zh:320a939a594c8a2563f4c11108e02428e7fda3bd51a4fc2298089299cf23f516", 168 + "zh:890df766e9b839623b1f0437355032a3c006226a6c200cd911e15ee1a9014e9f", 169 + "zh:9407fe1f9d332ecbd5252faa5b04f62b7fa47f19efe35a9e92d30ef2c603db45", 170 + "zh:a0af6ad4d4a52a1355df5b73fe38e406f50d9fd5c8af165929a602f906de0ff7", 171 + "zh:a44628f6e9bc612dbdcb013a8cf33aca3893f1697c4492847859f7db5b59c4dd", 172 + "zh:abaaa7d71f7975505824adcebed320aae43fc7e13c901ffc51448f6eb59585fe", 173 + "zh:ad2b1b3f348ad478ee64d294a85835625e560324e58a826530b13f49fafa9bac", 174 + "zh:e8bec252634868283e47ef1208cb89b53c1e0cdd2ad804acf91d0ff368048416", 175 + ] 176 + } 177 + 178 + provider "registry.opentofu.org/loafoe/ssh" { 179 + version = "2.7.0" 180 + constraints = "2.7.0" 181 + hashes = [ 182 + "h1:nS2pWJGlloMrIIbarr49YrrvVxAgjrIi/10hSWlKs5Y=", 183 + "zh:0301be53defa9294c713fb3ce4c9925e83051b7444b6eb7262c692ad514f9c46", 184 + "zh:2670797441d6fefddaaac4498f31b0dc8053fe82a3744fca44da7471e6449f1f", 185 + "zh:2d70166644fba761aec397920e9e843cce2c060875ddd224f7791ea2cd7bd6e6", 186 + "zh:30bda314598fee47cf890adfb6f3e1db606feab99252ccfdd0e5c93108f38fdd", 187 + "zh:3a0c0c9f1aff15818fb5fe97b361b879baf19886d413fa468165c3c6de49d348", 188 + "zh:5183c1a7fb5d1f1394bfcfe716a61c4191198ccbd64311601c68c52a3a1ea7e2", 189 + "zh:5190fd7e18f0e46d2263fafa04a6862578abb1c14d60ea3e6597f1b00b041ec7", 190 + "zh:825e2a7eb6c176dc96b82a1123d63ce6e04ef502a973a7ac44ab156cae4f991a", 191 + "zh:8e0716c9a628801284663cad3a8f70e026780f34d04fa5ffb822f0cd5876c353", 192 + "zh:8f19c94a72fb4cecdc70ac97f04c24fa24c46a4e125bbb7c24f642e95f753c70", 193 + "zh:a965929f10651c7139009aa509a6929f2205f90e85ce91a8354416d17624ed04", 194 + ] 195 + }
envs/TF_VAR_hcloud_token

This is a binary file and will not be displayed.

+164
hcloud-microos-snapshots.pkr.hcl
··· 1 + /* 2 + * Creates a MicroOS snapshot for Kube-Hetzner 3 + */ 4 + packer { 5 + required_plugins { 6 + hcloud = { 7 + version = ">= 1.0.5" 8 + source = "github.com/hetznercloud/hcloud" 9 + } 10 + } 11 + } 12 + 13 + variable "hcloud_token" { 14 + type = string 15 + default = env("HCLOUD_TOKEN") 16 + sensitive = true 17 + } 18 + 19 + # We download the OpenSUSE MicroOS x86 image from an automatically selected mirror. 20 + variable "opensuse_microos_x86_mirror_link" { 21 + type = string 22 + default = "https://download.opensuse.org/tumbleweed/appliances/openSUSE-MicroOS.x86_64-ContainerHost-OpenStack-Cloud.qcow2" 23 + } 24 + 25 + # We download the OpenSUSE MicroOS ARM image from an automatically selected mirror. 26 + variable "opensuse_microos_arm_mirror_link" { 27 + type = string 28 + default = "https://download.opensuse.org/ports/aarch64/tumbleweed/appliances/openSUSE-MicroOS.aarch64-ContainerHost-OpenStack-Cloud.qcow2" 29 + } 30 + 31 + # If you need to add other packages to the OS, do it here in the default value, like ["vim", "curl", "wget"] 32 + # When looking for packages, you need to search for OpenSUSE Tumbleweed packages, as MicroOS is based on Tumbleweed. 33 + variable "packages_to_install" { 34 + type = list(string) 35 + default = [] 36 + } 37 + 38 + locals { 39 + needed_packages = join(" ", concat(["restorecond policycoreutils policycoreutils-python-utils setools-console audit bind-utils wireguard-tools fuse open-iscsi nfs-client xfsprogs cryptsetup lvm2 git cifs-utils bash-completion mtr tcpdump udica qemu-guest-agent"], var.packages_to_install)) 40 + 41 + # Add local variables for inline shell commands 42 + download_image = "wget --timeout=5 --waitretry=5 --tries=5 --retry-connrefused --inet4-only " 43 + 44 + write_image = <<-EOT 45 + set -ex 46 + echo 'MicroOS image loaded, writing to disk... ' 47 + qemu-img convert -p -f qcow2 -O host_device $(ls -a | grep -ie '^opensuse.*microos.*qcow2$') /dev/sda 48 + echo 'done. Rebooting...' 49 + sleep 1 && udevadm settle && reboot 50 + EOT 51 + 52 + install_packages = <<-EOT 53 + set -ex 54 + echo "First reboot successful, installing needed packages..." 55 + transactional-update --continue pkg install -y ${local.needed_packages} 56 + transactional-update --continue shell <<- EOF 57 + setenforce 0 58 + rpm --import https://rpm.rancher.io/public.key 59 + zypper install -y https://github.com/k3s-io/k3s-selinux/releases/download/v1.6.stable.1/k3s-selinux-1.6-1.sle.noarch.rpm 60 + zypper addlock k3s-selinux 61 + restorecon -Rv /etc/selinux/targeted/policy 62 + restorecon -Rv /var/lib 63 + setenforce 1 64 + EOF 65 + sleep 1 && udevadm settle && reboot 66 + EOT 67 + 68 + clean_up = <<-EOT 69 + set -ex 70 + echo "Second reboot successful, cleaning-up..." 71 + rm -rf /etc/ssh/ssh_host_* 72 + echo "Make sure to use NetworkManager" 73 + touch /etc/NetworkManager/NetworkManager.conf 74 + sleep 1 && udevadm settle 75 + EOT 76 + } 77 + 78 + # Source for the MicroOS x86 snapshot 79 + source "hcloud" "microos-x86-snapshot" { 80 + image = "ubuntu-24.04" 81 + rescue = "linux64" 82 + location = "nbg1" 83 + server_type = "cx23" # disk size of >= 40GiB is needed to install the MicroOS image 84 + snapshot_labels = { 85 + microos-snapshot = "yes" 86 + creator = "kube-hetzner" 87 + } 88 + snapshot_name = "OpenSUSE MicroOS x86 by Kube-Hetzner" 89 + ssh_username = "root" 90 + token = var.hcloud_token 91 + } 92 + 93 + # Source for the MicroOS ARM snapshot 94 + source "hcloud" "microos-arm-snapshot" { 95 + image = "ubuntu-24.04" 96 + rescue = "linux64" 97 + location = "nbg1" 98 + server_type = "cax11" # disk size of >= 40GiB is needed to install the MicroOS image 99 + snapshot_labels = { 100 + microos-snapshot = "yes" 101 + creator = "kube-hetzner" 102 + } 103 + snapshot_name = "OpenSUSE MicroOS ARM by Kube-Hetzner" 104 + ssh_username = "root" 105 + token = var.hcloud_token 106 + } 107 + 108 + # Build the MicroOS x86 snapshot 109 + build { 110 + sources = ["source.hcloud.microos-x86-snapshot"] 111 + 112 + # Download the MicroOS x86 image 113 + provisioner "shell" { 114 + inline = ["${local.download_image}${var.opensuse_microos_x86_mirror_link}"] 115 + } 116 + 117 + # Write the MicroOS x86 image to disk 118 + provisioner "shell" { 119 + inline = [local.write_image] 120 + expect_disconnect = true 121 + } 122 + 123 + # Ensure connection to MicroOS x86 and do house-keeping 124 + provisioner "shell" { 125 + pause_before = "5s" 126 + inline = [local.install_packages] 127 + expect_disconnect = true 128 + } 129 + 130 + # Ensure connection to MicroOS x86 and do house-keeping 131 + provisioner "shell" { 132 + pause_before = "5s" 133 + inline = [local.clean_up] 134 + } 135 + } 136 + 137 + # Build the MicroOS ARM snapshot 138 + build { 139 + sources = ["source.hcloud.microos-arm-snapshot"] 140 + 141 + # Download the MicroOS ARM image 142 + provisioner "shell" { 143 + inline = ["${local.download_image}${var.opensuse_microos_arm_mirror_link}"] 144 + } 145 + 146 + # Write the MicroOS ARM image to disk 147 + provisioner "shell" { 148 + inline = [local.write_image] 149 + expect_disconnect = true 150 + } 151 + 152 + # Ensure connection to MicroOS ARM and do house-keeping 153 + provisioner "shell" { 154 + pause_before = "5s" 155 + inline = [local.install_packages] 156 + expect_disconnect = true 157 + } 158 + 159 + # Ensure connection to MicroOS ARM and do house-keeping 160 + provisioner "shell" { 161 + pause_before = "5s" 162 + inline = [local.clean_up] 163 + } 164 + }
keypair/id_ed25519_tub

This is a binary file and will not be displayed.

keypair/id_ed25519_tub.pub

This is a binary file and will not be displayed.

+1158
kube.tf
··· 1 + locals { 2 + # You have the choice of setting your Hetzner API token here or define the TF_VAR_hcloud_token env 3 + # within your shell, such as: export TF_VAR_hcloud_token=xxxxxxxxxxx 4 + # If you choose to define it in the shell, this can be left as is. 5 + 6 + # Your Hetzner token can be found in your Project > Security > API Token (Read & Write is required). 7 + hcloud_token = "xxxxxxxxxxx" 8 + } 9 + 10 + module "kube-hetzner" { 11 + providers = { 12 + hcloud = hcloud 13 + } 14 + hcloud_token = var.hcloud_token != "" ? var.hcloud_token : local.hcloud_token 15 + 16 + # Then fill or edit the below values. Only the first values starting with a * are obligatory; the rest can remain with their default values, or you 17 + # could adapt them to your needs. 18 + 19 + # * source can be specified in multiple ways: 20 + # 1. For normal use, (the official version published on the Terraform Registry), use 21 + source = "kube-hetzner/kube-hetzner/hcloud" 22 + # When using the terraform registry as source, you can optionally specify a version number. 23 + # See https://registry.terraform.io/modules/kube-hetzner/kube-hetzner/hcloud for the available versions 24 + # version = "2.15.3" 25 + # 2. For local dev, path to the git repo 26 + # source = "../../kube-hetzner/" 27 + # 3. If you want to use the latest master branch (see https://developer.hashicorp.com/terraform/language/modules/sources#github), use 28 + # source = "github.com/kube-hetzner/terraform-hcloud-kube-hetzner" 29 + 30 + # Note that some values, notably "location" and "public_key" have no effect after initializing the cluster. 31 + # This is to keep Terraform from re-provisioning all nodes at once, which would lose data. If you want to update 32 + # those, you should instead change the value here and manually re-provision each node. Grep for "lifecycle". 33 + 34 + # Customize the SSH port (by default 22) 35 + # ssh_port = 2222 36 + 37 + # * Your ssh public key 38 + ssh_public_key = file("./keypair/id_ed25519_tub.pub") 39 + # * Your private key must be "ssh_private_key = null" when you want to use ssh-agent for a Yubikey-like device authentication or an SSH key-pair with a passphrase. 40 + # For more details on SSH see https://github.com/kube-hetzner/kube-hetzner/blob/master/docs/ssh.md 41 + ssh_private_key = file("./keypair/id_ed25519_tub") 42 + # You can add additional SSH public Keys to grant other team members root access to your cluster nodes. 43 + # ssh_additional_public_keys = [] 44 + 45 + # You can also add additional SSH public Keys which are saved in the hetzner cloud by a label. 46 + # See https://docs.hetzner.cloud/#label-selector 47 + # ssh_hcloud_key_label = "role=admin" 48 + 49 + # If you use SSH agent and have issues with SSH connecting to your nodes, you can increase the number of auth tries (default is 2) 50 + # ssh_max_auth_tries = 10 51 + 52 + # If you want to use an ssh key that is already registered within hetzner cloud, you can pass its id. 53 + # If no id is passed, a new ssh key will be registered within hetzner cloud. 54 + # It is important that exactly this key is passed via `ssh_public_key` & `ssh_private_key` variables. 55 + # hcloud_ssh_key_id = "" 56 + 57 + # These can be customized, or left with the default values 58 + # * For Hetzner locations see https://docs.hetzner.com/general/others/data-centers-and-connection/ 59 + network_region = "eu-central" # change to `us-east` if location is ash 60 + 61 + # If you want to create the private network before calling this module, 62 + # you can do so and pass its id here. For example if you want to use a proxy 63 + # which only listens on your private network. Advanced use case. 64 + # 65 + # NOTE1: make sure to adapt network_ipv4_cidr, cluster_ipv4_cidr, and service_ipv4_cidr accordingly. 66 + # If your network is created with 10.0.0.0/8, and you use subnet 10.128.0.0/9 for your 67 + # non-k3s business, then adapting `network_ipv4_cidr = "10.0.0.0/9"` should be all you need. 68 + # 69 + # NOTE2: square brackets! This must be a list of length 1. 70 + # 71 + # existing_network_id = [hcloud_network.your_network.id] 72 + 73 + # If you must change the network CIDR you can do so below, but it is highly advised against. 74 + # network_ipv4_cidr = "10.0.0.0/8" 75 + 76 + # Using the default configuration you can only create a maximum of 42 agent-nodepools. 77 + # This is due to the creation of a subnet for each nodepool with CIDRs being in the shape of 10.[nodepool-index].0.0/16 which collides with k3s' cluster and service IP ranges (defaults below). 78 + # Furthermore the maximum number of nodepools (controlplane and agent) is 50, due to a hard limit of 50 subnets per network, see https://docs.hetzner.com/cloud/networks/faq/. 79 + # So to be able to create a maximum of 50 nodepools in total, the values below have to be changed to something outside that range, e.g. `10.200.0.0/16` and `10.201.0.0/16` for cluster and service respectively. 80 + 81 + # If you must change the cluster CIDR you can do so below, but it is highly advised against. 82 + # Never change this value after you already initialized a cluster. Complete cluster redeploy needed! 83 + # The cluster CIDR must be a part of the network CIDR! 84 + # cluster_ipv4_cidr = "10.42.0.0/16" 85 + 86 + # If you must change the service CIDR you can do so below, but it is highly advised against. 87 + # Never change this value after you already initialized a cluster. Complete cluster redeploy needed! 88 + # The service CIDR must be a part of the network CIDR! 89 + # service_ipv4_cidr = "10.43.0.0/16" 90 + 91 + # If you must change the service IPv4 address of core-dns you can do so below, but it is highly advised against. 92 + # Never change this value after you already initialized a cluster. Complete cluster redeploy needed! 93 + # The service IPv4 address must be part of the service CIDR! 94 + # cluster_dns_ipv4 = "10.43.0.10" 95 + 96 + # For the control planes, at least three nodes are the minimum for HA. Otherwise, you need to turn off the automatic upgrades (see README). 97 + # **It must always be an ODD number, never even!** Search the internet for "split-brain problem with etcd" or see https://rancher.com/docs/k3s/latest/en/installation/ha-embedded/ 98 + # 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. 99 + 100 + # 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. 101 + # For the server type, the minimum instance supported is cx23. If you want to use arm64 use cax11; see https://www.hetzner.com/cloud. 102 + 103 + # 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. 104 + # 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). 105 + # You can also rename it (if the count is 0), but do not remove a nodepool from the list. 106 + 107 + # You can safely add or remove nodepools at the end of each list. That is due to how subnets and IPs get allocated (FILO). 108 + # The maximum number of nodepools you can create combined for both lists is 50 (see above). 109 + # 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. 110 + 111 + # 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. 112 + # ⚠️ The nodepool names are entirely arbitrary, but all lowercase, no special characters or underscore (dashes are allowed), and they must be unique. 113 + 114 + # 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. 115 + 116 + # Please note that changing labels and taints after the first run will have no effect. If needed, you can do that through Kubernetes directly. 117 + 118 + # Multi-architecture clusters are OK for most use cases, as container underlying images tend to be multi-architecture too. 119 + 120 + # * Example below: 121 + 122 + control_plane_nodepools = [ 123 + { 124 + name = "control-plane", 125 + server_type = "cx33", 126 + location = "nbg1", 127 + labels = [], 128 + taints = [], 129 + count = 1 130 + } 131 + ] 132 + 133 + agent_nodepools = [] 134 + 135 + # Add additional configuration options for control planes here. 136 + # E.g to enable monitoring for etcd, proxy etc: 137 + # control_planes_custom_config = { 138 + # etcd-expose-metrics = true, 139 + # kube-controller-manager-arg = "bind-address=0.0.0.0", 140 + # kube-proxy-arg ="metrics-bind-address=0.0.0.0", 141 + # kube-scheduler-arg = "bind-address=0.0.0.0", 142 + # } 143 + 144 + # Add additional configuration options for agent nodes and autoscaler nodes here. 145 + # E.g to enable monitoring for proxy: 146 + # agent_nodes_custom_config = { 147 + # kube-proxy-arg ="metrics-bind-address=0.0.0.0", 148 + # } 149 + 150 + # You can enable encrypted wireguard for the CNI by setting this to "true". Default is "false". 151 + # FYI, Hetzner says "Traffic between cloud servers inside a Network is private and isolated, but not automatically encrypted." 152 + # Source: https://docs.hetzner.com/cloud/networks/faq/#is-traffic-inside-hetzner-cloud-networks-encrypted 153 + # It works with all CNIs that we support. 154 + # Just note, that if Cilium with cilium_values, the responsibility of enabling of disabling Wireguard falls on you. 155 + # enable_wireguard = true 156 + 157 + # * 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 158 + load_balancer_type = "lb11" 159 + load_balancer_location = "nbg1" 160 + 161 + # Disable IPv6 for the load balancer, the default is false. 162 + # load_balancer_disable_ipv6 = true 163 + 164 + # Disables the public network of the load balancer. (default: false). 165 + # load_balancer_disable_public_network = true 166 + 167 + # Specifies the algorithm type of the load balancer. (default: round_robin). 168 + # load_balancer_algorithm_type = "least_connections" 169 + 170 + # Specifies the interval at which a health check is performed. Minimum is 3s (default: 15s). 171 + # load_balancer_health_check_interval = "5s" 172 + 173 + # Specifies the timeout of a single health check. Must not be greater than the health check interval. Minimum is 1s (default: 10s). 174 + # load_balancer_health_check_timeout = "3s" 175 + 176 + # Specifies the number of times a health check is retried before a target is marked as unhealthy. (default: 3) 177 + # load_balancer_health_check_retries = 3 178 + 179 + 180 + # Setup a NAT router, and automatically disable public ips on all control plane and agent nodes. 181 + # To use this, you must also set use_control_plane_lb = true, otherwise kubectl can never 182 + # reach the cluster. The NAT router will also function as bastion. This makes securing the cluster 183 + # easier, as all public traffic passes through a single strongly secured node. It does 184 + # however also introduce a single point of failure, so if you need high-availability on your 185 + # egress, you should consider other configurations. 186 + # 187 + # Hetzner removed the DHCP Router option from private networks on 2025-08-11, so the module 188 + # now ensures each node attached to the private network persists a default route via the 189 + # virtual gateway. No manual `ip route add` is required after reboots or DHCP renewals. 190 + # 191 + # 192 + # nat_router = { 193 + # server_type = "cax21" 194 + # location = "nbg1" 195 + # enable_sudo = false # optional, default to false. Set to true to add nat-router user to the sudo'ers. Note that ssh as root is disabled. 196 + # labels = {} # optionally add labels. 197 + # } 198 + 199 + 200 + ### The following values are entirely optional (and can be removed from this if unused) 201 + 202 + # You can refine a base domain name to be use in this form of nodename.base_domain for setting the reverse dns inside Hetzner 203 + # base_domain = "mycluster.example.com" 204 + 205 + # Cluster Autoscaler 206 + # Providing at least one map for the array enables the cluster autoscaler feature, default is disabled. 207 + # ⚠️ Based on how the autoscaler works with this project, you can only choose either x86 instances or ARM server types for ALL autoscaler nodepools. 208 + # If you are curious, it's ok to have a multi-architecture cluster, as most underlying container images are multi-architecture too. 209 + # 210 + # ⚠️ Setting labels and taints will only work on cluster-autoscaler images versions released after > 20 October 2023. Or images built from master after that date. 211 + # 212 + # * Example below: 213 + # autoscaler_nodepools = [ 214 + # { 215 + # name = "autoscaled-small" 216 + # server_type = "cx33" 217 + # location = "nbg1" 218 + # # Add the arg --enforce-node-group-min-size=true in the cluster_autoscaler_extra_args option below if you want min_nodes to be effective 219 + # min_nodes = 0 220 + # max_nodes = 5 221 + # labels = { 222 + # "node.kubernetes.io/role": "peak-workloads" 223 + # } 224 + # taints = [ 225 + # { 226 + # key= "node.kubernetes.io/role" 227 + # value= "peak-workloads" 228 + # effect= "NoExecute" 229 + # } 230 + # ] 231 + # # kubelet_args = ["kube-reserved=cpu=250m,memory=1500Mi,ephemeral-storage=1Gi", "system-reserved=cpu=250m,memory=300Mi"] 232 + # } 233 + # ] 234 + # 235 + # To disable public ips on your autoscaled nodes, uncomment the following lines: 236 + # autoscaler_disable_ipv4 = true 237 + # autoscaler_disable_ipv6 = true 238 + 239 + # ⚠️ Deprecated, will be removed after a new Cluster Autoscaler version has been released which support the new way of setting labels and taints. See above. 240 + # Add extra labels on nodes started by the Cluster Autoscaler 241 + # This argument is not used if autoscaler_nodepools is not set, because the Cluster Autoscaler is installed only if autoscaler_nodepools is set 242 + # autoscaler_labels = [ 243 + # "node.kubernetes.io/role=peak-workloads" 244 + # ] 245 + 246 + # Add extra taints on nodes started by the Cluster Autoscaler 247 + # This argument is not used if autoscaler_nodepools is not set, because the Cluster Autoscaler is installed only if autoscaler_nodepools is set 248 + # autoscaler_taints = [ 249 + # "node.kubernetes.io/role=specific-workloads:NoExecute" 250 + # ] 251 + 252 + # Configuration of the Cluster Autoscaler binary 253 + # 254 + # These arguments and variables are not used if autoscaler_nodepools is not set, because the Cluster Autoscaler is installed only if autoscaler_nodepools is set. 255 + # 256 + # Image and version of Kubernetes Cluster Autoscaler for Hetzner Cloud: 257 + # - cluster_autoscaler_image: Image of Kubernetes Cluster Autoscaler for Hetzner Cloud to be used. 258 + # The default is the official image from the Kubernetes project: registry.k8s.io/autoscaling/cluster-autoscaler 259 + # - cluster_autoscaler_version: Version of Kubernetes Cluster Autoscaler for Hetzner Cloud. Should be aligned with Kubernetes version. 260 + # Available versions for the official image can be found at https://explore.ggcr.dev/?repo=registry.k8s.io%2Fautoscaling%2Fcluster-autoscaler 261 + # 262 + # Logging related arguments are managed using separate variables: 263 + # - cluster_autoscaler_log_level: Controls the verbosity of logs (--v), the value is from 0 to 5, default is 4, for max debug info set it to 5. 264 + # - cluster_autoscaler_log_to_stderr: Determines whether to log to stderr (--logtostderr). 265 + # - cluster_autoscaler_stderr_threshold: Sets the threshold for logs that go to stderr (--stderrthreshold). 266 + # 267 + # Server/node creation timeout variable: 268 + # - cluster_autoscaler_server_creation_timeout: Sets the timeout (in minutes) until which a newly created server/node has to become available before giving up and destroying it (defaults to 15, unit is minutes) 269 + # 270 + # Example: 271 + # 272 + # cluster_autoscaler_image = "registry.k8s.io/autoscaling/cluster-autoscaler" 273 + # cluster_autoscaler_version = "v1.30.3" 274 + # cluster_autoscaler_log_level = 4 275 + # cluster_autoscaler_log_to_stderr = true 276 + # cluster_autoscaler_stderr_threshold = "INFO" 277 + # cluster_autoscaler_server_creation_timeout = 15 278 + 279 + # Additional Cluster Autoscaler binary configuration 280 + # 281 + # cluster_autoscaler_extra_args can be used for additional arguments. The default is an empty array. 282 + # 283 + # Please note that following arguments are managed by terraform-hcloud-kube-hetzner or the variables above and should not be set manually: 284 + # - --v=${var.cluster_autoscaler_log_level} 285 + # - --logtostderr=${var.cluster_autoscaler_log_to_stderr} 286 + # - --stderrthreshold=${var.cluster_autoscaler_stderr_threshold} 287 + # - --cloud-provider=hetzner 288 + # - --nodes ... 289 + # 290 + # See the Cluster Autoscaler FAQ for the full list of arguments: https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-the-parameters-to-ca 291 + # 292 + # Example: 293 + # 294 + # cluster_autoscaler_extra_args = [ 295 + # "--ignore-daemonsets-utilization=true", 296 + # "--enforce-node-group-min-size=true", 297 + # ] 298 + 299 + # Enable delete protection on compatible resources to prevent accidental deletion from the Hetzner Cloud Console. 300 + # This does not protect deletion from Terraform itself. 301 + # enable_delete_protection = { 302 + # floating_ip = true 303 + # load_balancer = true 304 + # volume = true 305 + # } 306 + 307 + # Enable etcd snapshot backups to S3 storage. 308 + # Just provide a map with the needed settings (according to your S3 storage provider) and backups to S3 will 309 + # be enabled (with the default settings for etcd snapshots). 310 + # Cloudflare's R2 offers 10GB, 10 million reads and 1 million writes per month for free. 311 + # For proper context, have a look at https://docs.k3s.io/datastore/backup-restore. 312 + # You also can use additional parameters from https://docs.k3s.io/cli/etcd-snapshot, such as `etc-s3-folder` 313 + # etcd_s3_backup = { 314 + # etcd-s3-endpoint = "xxxx.r2.cloudflarestorage.com" 315 + # etcd-s3-access-key = "<access-key>" 316 + # etcd-s3-secret-key = "<secret-key>" 317 + # etcd-s3-bucket = "k3s-etcd-snapshots" 318 + # etcd-s3-region = "<your-s3-bucket-region|usually required for aws>" 319 + # } 320 + 321 + # To enable Hetzner Storage Box support, you can enable csi-driver-smb, default is "false". 322 + # enable_csi_driver_smb = true 323 + # If you want to specify the version for csi-driver-smb, set it below - otherwise it'll use the latest version available. 324 + # See https://github.com/kubernetes-csi/csi-driver-smb/releases for the available versions. 325 + # csi_driver_smb_version = "v1.16.0" 326 + 327 + # To enable iscid without setting enable_longhorn = true, set enable_iscsid = true. You will need this if 328 + # you install your own version of longhorn outside of this module. 329 + # Default is false. If enable_longhorn=true, this variable is ignored and iscsid is enabled anyway. 330 + # enable_iscsid = true 331 + 332 + # To use local storage on the nodes, you can enable Longhorn, default is "false". 333 + # See a full recap on how to configure agent nodepools for longhorn here https://github.com/kube-hetzner/terraform-hcloud-kube-hetzner/discussions/373#discussioncomment-3983159 334 + # Also see Longhorn best practices here https://gist.github.com/ifeulner/d311b2868f6c00e649f33a72166c2e5b 335 + enable_longhorn = false 336 + 337 + # By default, longhorn is pulled from https://charts.longhorn.io. 338 + # If you need a version of longhorn which assures compatibility with rancher you can set this variable to https://charts.rancher.io. 339 + # longhorn_repository = "https://charts.rancher.io" 340 + 341 + # The namespace for longhorn deployment, default is "longhorn-system". 342 + # longhorn_namespace = "longhorn-system" 343 + 344 + # The file system type for Longhorn, if enabled (ext4 is the default, otherwise you can choose xfs). 345 + # longhorn_fstype = "xfs" 346 + 347 + # how many replica volumes should longhorn create (default is 3). 348 + # longhorn_replica_count = 1 349 + 350 + # When you enable Longhorn, you can go with the default settings and just modify the above two variables OR you can add a longhorn_values variable 351 + # with all needed helm values, see towards the end of the file in the advanced section. You can also use longhorn_merge_values. 352 + # If that file is present, the system will use it during the deploy, if not it will use the default values with the two variable above that can be customized. 353 + # After the cluster is deployed, you can always use HelmChartConfig definition to tweak the configuration. 354 + 355 + # Also, you can choose to use a Hetzner volume with Longhorn. By default, it will use the nodes own storage space, but if you add an attribute of 356 + # longhorn_volume_size (⚠️ not a variable, just a possible agent nodepool attribute) with a value between 10 and 10240 GB to your agent nodepool definition, it will create and use the volume in question. 357 + # See the agent nodepool section for an example of how to do that. 358 + 359 + # To disable Hetzner CSI storage, you can set the following to "true", default is "false". 360 + # disable_hetzner_csi = true 361 + 362 + # If you want to use a specific Hetzner CCM and CSI version, set them below; otherwise, leave them as-is for the latest versions. 363 + # See https://github.com/hetznercloud/hcloud-cloud-controller-manager/releases for the available versions. 364 + # hetzner_ccm_version = "" 365 + 366 + # By default, new installations use Helm to install Hetzner CCM. You can use the legacy deployment method (using `kubectl apply`) by setting `hetzner_ccm_use_helm = false`. 367 + hetzner_ccm_use_helm = true 368 + 369 + # See https://github.com/hetznercloud/csi-driver/releases for the available versions. 370 + # hetzner_csi_version = "" 371 + 372 + # If you want to specify the Kured version, set it below - otherwise it'll use the latest version available. 373 + # See https://github.com/kubereboot/kured/releases for the available versions. 374 + # kured_version = "" 375 + 376 + # Default is "traefik". 377 + # If you want to enable the Nginx (https://kubernetes.github.io/ingress-nginx/) or HAProxy ingress controller instead of Traefik, you can set this to "nginx" or "haproxy". 378 + # By the default we load optimal Traefik, Nginx or HAProxy ingress controller config for Hetzner, however you may need to tweak it to your needs, so to do, 379 + # we allow you to add a traefik_values, nginx_values or haproxy_values, see towards the end of this file in the advanced section. 380 + # You can also use *_merge_values to overlay defaults (or the *_values file if set). 381 + # After the cluster is deployed, you can always use HelmChartConfig definition to tweak the configuration. 382 + # If you want to disable both controllers set this to "none" 383 + # ingress_controller = "nginx" 384 + # Namespace in which to deploy the ingress controllers. Defaults to the ingress_controller variable, eg (haproxy, nginx, traefik) 385 + # ingress_target_namespace = "" 386 + 387 + # You can change the number of replicas for selected ingress controller here. The default 0 means autoselecting based on number of agent nodes (1 node = 1 replica, 2 nodes = 2 replicas, 3+ nodes = 3 replicas) 388 + ingress_replica_count = 1 389 + 390 + # Use the klipperLB (similar to metalLB), instead of the default Hetzner one, that has an advantage of dropping the cost of the setup. 391 + # Automatically "true" in the case of single node cluster (as it does not make sense to use the Hetzner LB in that situation). 392 + # It can work with any ingress controller that you choose to deploy. 393 + # Please note that because the klipperLB points to all nodes, we automatically allow scheduling on the control plane when it is active. 394 + # enable_klipper_metal_lb = "true" 395 + 396 + # 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/ 397 + # They are the options that go into the additionalArguments section of the Traefik helm values file. 398 + # We already add "providers.kubernetesingress.ingressendpoint.publishedservice" by default so that Traefik works automatically with services such as External-DNS and ArgoCD. 399 + # Example: 400 + # traefik_additional_options = ["--log.level=DEBUG", "--tracing=true"] 401 + 402 + # By default traefik image tag is an empty string which uses latest image tag. 403 + # The default is "". 404 + # traefik_image_tag = "v3.0.0-beta5" 405 + 406 + # By default traefik is configured to redirect http traffic to https, you can set this to "false" to disable the redirection. 407 + # The default is true. 408 + # traefik_redirect_to_https = false 409 + 410 + # Enable or disable Horizontal Pod Autoscaler for traefik. 411 + # The default is true. 412 + # traefik_autoscaling = false 413 + 414 + # Enable or disable pod disruption budget for traefik. Values are maxUnavailable: 33% and minAvailable: 1. 415 + # The default is true. 416 + # traefik_pod_disruption_budget = false 417 + 418 + # Enable kubernetes gateway api (https://doc.traefik.io/traefik/providers/kubernetes-gateway/) provider support. 419 + # The default is false. 420 + # traefik_provider_kubernetes_gateway_enabled = true 421 + 422 + # Enable or disable default resource requests and limits for traefik. Values requested are 100m & 50Mi and limits 300m & 150Mi. 423 + # The default is true. 424 + # traefik_resource_limits = false 425 + 426 + # If you want to configure additional ports for traefik, enter them here as a list of objects with name, port, and exposedPort properties. 427 + # Example: 428 + # traefik_additional_ports = [{name = "example", port = 1234, exposedPort = 1234}] 429 + 430 + # If you want to configure additional trusted IPs for traefik, enter them here as a list of IPs (strings). 431 + # Example for Cloudflare: 432 + # traefik_additional_trusted_ips = [ 433 + # "173.245.48.0/20", 434 + # "103.21.244.0/22", 435 + # "103.22.200.0/22", 436 + # "103.31.4.0/22", 437 + # "141.101.64.0/18", 438 + # "108.162.192.0/18", 439 + # "190.93.240.0/20", 440 + # "188.114.96.0/20", 441 + # "197.234.240.0/22", 442 + # "198.41.128.0/17", 443 + # "162.158.0.0/15", 444 + # "104.16.0.0/13", 445 + # "104.24.0.0/14", 446 + # "172.64.0.0/13", 447 + # "131.0.72.0/22", 448 + # "2400:cb00::/32", 449 + # "2606:4700::/32", 450 + # "2803:f800::/32", 451 + # "2405:b500::/32", 452 + # "2405:8100::/32", 453 + # "2a06:98c0::/29", 454 + # "2c0f:f248::/32" 455 + # ] 456 + 457 + # If you want to disable the metric server set this to "false". Default is "true". 458 + # enable_metrics_server = false 459 + 460 + # If you want to enable the k3s built-in local-storage controller set this to "true". Default is "false". 461 + # Warning: When enabled together with the Hetzner CSI, there will be two default storage classes: "local-path" and "hcloud-volumes"! 462 + # Even if patched to remove the "default" label, the local-path storage class will be reset as default on each reboot of 463 + # the node where the controller runs. 464 + # This is not a problem if you explicitly define which storageclass to use in your PVCs. 465 + # Workaround if you don't want two default storage classes: leave this to false and add the local-path-provisioner helm chart 466 + # as an extra (https://github.com/kube-hetzner/terraform-hcloud-kube-hetzner#adding-extras). 467 + # enable_local_storage = false 468 + 469 + allow_scheduling_on_control_plane = true 470 + 471 + # If you use both the Terraform-managed ingress LB AND CCM-managed LoadBalancer services, agents get registered to both. 472 + # Enable this to exclude agents from CCM LBs (adds node.kubernetes.io/exclude-from-external-load-balancers=true label). 473 + # WARNING: If allow_scheduling_on_control_plane=false, this leaves NO eligible targets for CCM LoadBalancer services. 474 + # exclude_agents_from_external_load_balancers = true 475 + 476 + # If you want to disable the automatic upgrade of k3s, you can set below to "false". 477 + # Ideally, keep it on, to always have the latest Kubernetes version, but lock the initial_k3s_channel to a kube major version, 478 + # of your choice, like v1.25 or v1.26. That way you get the best of both worlds without the breaking changes risk. 479 + # For production use, always use an HA setup with at least 3 control-plane nodes and 2 agents, and keep this on for maximum security. 480 + 481 + automatically_upgrade_k3s = true 482 + 483 + # By default nodes are drained before k3s upgrade, which will delete and transfer all pods to other nodes. 484 + # Set this to false to cordon nodes instead, which just prevents scheduling new pods on the node during upgrade 485 + # and keeps all pods running. This may be useful if you have pods which are known to be slow to start e.g. 486 + # because they have to mount volumes with many files which require to get the right security context applied. 487 + system_upgrade_use_drain = true 488 + 489 + # During k3s via system-upgrade-manager pods are evicted by default. 490 + # On small clusters this can lead to hanging upgrades and indefinitely unschedulable nodes, 491 + # in that case, set this to false to immediately delete pods before upgrading. 492 + # NOTE: Turning this flag off might lead to downtimes of services (which may be acceptable for your use case) 493 + # NOTE: This flag takes effect only when system_upgrade_use_drain is set to true. 494 + # system_upgrade_enable_eviction = false 495 + 496 + automatically_upgrade_os = true 497 + 498 + # If you need more control over kured and the reboot behaviour, you can pass additional options to kured. 499 + # For example limiting reboots to certain timeframes. For all options see: https://kured.dev/docs/configuration/ 500 + # By default, the kured lock does not expire and is only released once a node successfully reboots. You can add the option 501 + # "lock-ttl" : "30m", if you have a single node which sometimes gets stuck. Note however, that in that case, kured continuous 502 + # draining the next node because the lock was released. You may end up with all nodes drained and your cluster completely down. 503 + # The default options are: `--reboot-command=/usr/bin/systemctl reboot --pre-reboot-node-labels=kured=rebooting --post-reboot-node-labels=kured=done --period=5m` 504 + # Defaults can be overridden by using the same key. 505 + # kured_options = { 506 + # "reboot-days": "su", 507 + # "start-time": "3am", 508 + # "end-time": "8am", 509 + # "time-zone": "Local", 510 + # "lock-ttl" : "30m", 511 + # } 512 + 513 + # Allows you to specify the k3s version. If defined, supersedes initial_k3s_channel. 514 + # See https://github.com/k3s-io/k3s/releases for the available versions. 515 + # install_k3s_version = "v1.30.2+k3s2" 516 + 517 + # Allows you to specify either stable, latest, testing or supported minor versions. 518 + # see https://rancher.com/docs/k3s/latest/en/upgrades/basic/ and https://update.k3s.io/v1-release/channels 519 + # ⚠️ If you are going to use Rancher addons for instance, it's always a good idea to fix the kube version to one minor version below the latest stable, 520 + # e.g. v1.29 instead of the stable v1.30. 521 + # The default is "v1.30". 522 + initial_k3s_channel = "v1.31" 523 + 524 + # Allows to specify the version of the System Upgrade Controller for automated upgrades of k3s 525 + # See https://github.com/rancher/system-upgrade-controller/releases for the available versions. 526 + # sys_upgrade_controller_version = "v0.14.2" 527 + 528 + # The cluster name, by default "k3s" 529 + # cluster_name = "" 530 + 531 + # Whether to use the cluster name in the node name, in the form of {cluster_name}-{nodepool_name}, the default is "true". 532 + # use_cluster_name_in_node_name = false 533 + 534 + # Extra k3s registries. This is useful if you have private registries and you want to pull images without additional secrets. 535 + # Or if you want to proxy registries for various reasons like rate-limiting. 536 + # It will create the registries.yaml file, more info here https://docs.k3s.io/installation/private-registry. 537 + # Note that you do not need to get this right from the first time, you can update it when you want during the life of your cluster. 538 + # The default is blank. 539 + /* k3s_registries = <<-EOT 540 + mirrors: 541 + hub.my_registry.com: 542 + endpoint: 543 + - "hub.my_registry.com" 544 + configs: 545 + hub.my_registry.com: 546 + auth: 547 + username: username 548 + password: password 549 + EOT */ 550 + 551 + # Additional environment variables for the host OS on which k3s runs. See for example https://docs.k3s.io/advanced#configuring-an-http-proxy . 552 + # additional_k3s_environment = { 553 + # "CONTAINERD_HTTP_PROXY" : "http://your.proxy:port", 554 + # "CONTAINERD_HTTPS_PROXY" : "http://your.proxy:port", 555 + # "NO_PROXY" : "127.0.0.0/8,10.0.0.0/8,", 556 + # } 557 + 558 + # Additional commands to execute on the host OS before the k3s install, for example fetching and installing certs. 559 + # preinstall_exec = [ 560 + # "curl https://somewhere.over.the.rainbow/ca.crt > /root/ca.crt", 561 + # "trust anchor --store /root/ca.crt", 562 + # ] 563 + 564 + # Structured authentication configuration. Multiple authentication providers support requires v1.30+ of 565 + # kubernetes. 566 + # https://kubernetes.io/docs/reference/access-authn-authz/authentication/#using-authentication-configuration 567 + # 568 + # authentication_config = <<-EOT 569 + # apiVersion: apiserver.config.k8s.io/v1beta1 570 + # kind: AuthenticationConfiguration 571 + # jwt: 572 + # - issuer: 573 + # url: "https://token.actions.githubusercontent.com" 574 + # audiences: 575 + # - "https://github.com/octo-org" 576 + # claimMappings: 577 + # username: 578 + # claim: sub 579 + # prefix: "gh:" 580 + # groups: 581 + # claim: repository_owner 582 + # prefix: "gh:" 583 + # claimValidationRules: 584 + # - claim: repository 585 + # requiredValue: "octo-org/octo-repo" 586 + # - claim: "repository_visibility" 587 + # requiredValue: "public" 588 + # - claim: "ref" 589 + # requiredValue: "refs/heads/main" 590 + # - claim: "ref_type" 591 + # requiredValue: "branch" 592 + # - issuer: 593 + # url: "https://your.oidc.issuer" 594 + # audiences: 595 + # - "oidc_client_id" 596 + # claimMappings: 597 + # username: 598 + # claim: oidc_username_claim 599 + # prefix: "oidc:" 600 + # groups: 601 + # claim: oidc_groups_claim 602 + # prefix: "oidc:" 603 + # EOT 604 + 605 + # Set to true if util-linux breaks on the OS (temporary regression fixed in util-linux v2.41.1). 606 + # k3s_prefer_bundled_bin = true 607 + 608 + # Additional flags to pass to the k3s server command (the control plane). 609 + # k3s_exec_server_args = "--kube-apiserver-arg enable-admission-plugins=PodTolerationRestriction,PodNodeSelector" 610 + 611 + # Additional flags to pass to the k3s agent command (every agents nodes, including autoscaler nodepools). 612 + # k3s_exec_agent_args = "--kubelet-arg kube-reserved=cpu=100m,memory=200Mi,ephemeral-storage=1Gi" 613 + 614 + # The vars below here passes it to the k3s config.yaml. This way it persist across reboots 615 + # Make sure you set "feature-gates=NodeSwap=true" if want to use swap_size 616 + # Note: CloudDualStackNodeIPs was removed in K8s 1.32 (always enabled now) 617 + # see https://github.com/k3s-io/k3s/issues/8811#issuecomment-1856974516 618 + # k3s_global_kubelet_args = ["kube-reserved=cpu=100m,ephemeral-storage=1Gi", "system-reserved=cpu=memory=200Mi", "image-gc-high-threshold=50", "image-gc-low-threshold=40"] 619 + # k3s_control_plane_kubelet_args = [] 620 + # k3s_agent_kubelet_args = [] 621 + # k3s_autoscaler_kubelet_args = [] 622 + 623 + # https://kubernetes.io/docs/reference/config-api/kubelet-config.v1beta1/ 624 + # k3s_kubelet_config = <<-EOT 625 + # apiVersion: kubelet.config.k8s.io/v1beta1 626 + # kind: KubeletConfiguration 627 + # imageGCLowThresholdPercent: 40 628 + # imageGCHighThresholdPercent: 50 629 + # imageMaximumGCAge: 24h 630 + # EOT 631 + 632 + # If you want to allow all outbound traffic you can set this to "false". Default is "true". 633 + # restrict_outbound_traffic = false 634 + 635 + # Allow access to the Kube API from the specified networks. The default is ["0.0.0.0/0", "::/0"]. 636 + # Allowed values: null (disable Kube API rule entirely) or a list of allowed networks with CIDR notation. 637 + # For maximum security, it's best to disable it completely by setting it to null. However, in that case, to get access to the kube api, 638 + # you would have to connect to any control plane node via SSH, as you can run kubectl from within these. 639 + # Please be advised that this setting has no effect on the load balancer when the use_control_plane_lb variable is set to true. This is 640 + # because firewall rules cannot be applied to load balancers yet. 641 + firewall_kube_api_source = ["5.132.113.114"] 642 + 643 + # Allow SSH access from the specified networks. Default: ["0.0.0.0/0", "::/0"] 644 + # Allowed values: null (disable SSH rule entirely) or a list of allowed networks with CIDR notation. 645 + # Ideally you would set your IP there. And if it changes after cluster deploy, you can always update this variable and apply again. 646 + firewall_ssh_source = ["5.132.113.114"] 647 + 648 + # By default, SELinux is enabled in enforcing mode on all nodes. For container-specific SELinux issues, 649 + # consider using the pre-installed 'udica' tool to create custom, targeted SELinux policies instead of 650 + # disabling SELinux globally. See the "Fix SELinux issues with udica" example in the README for details. 651 + # disable_selinux = false 652 + 653 + # Adding extra firewall rules, like opening a port 654 + # More info on the format here https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs/resources/firewall 655 + # extra_firewall_rules = [ 656 + # { 657 + # description = "For Postgres" 658 + # direction = "in" 659 + # protocol = "tcp" 660 + # port = "5432" 661 + # source_ips = ["0.0.0.0/0", "::/0"] 662 + # destination_ips = [] # Won't be used for this rule 663 + # }, 664 + # { 665 + # description = "To Allow ArgoCD access to resources via SSH" 666 + # direction = "out" 667 + # protocol = "tcp" 668 + # port = "22" 669 + # source_ips = [] # Won't be used for this rule 670 + # destination_ips = ["0.0.0.0/0", "::/0"] 671 + # } 672 + # ] 673 + 674 + # If you want to configure a different CNI for k3s, use this flag 675 + # possible values: flannel (Default), calico, and cilium 676 + # As for Cilium, we allow infinite configurations via helm values, please check the CNI section of the readme over at https://github.com/kube-hetzner/terraform-hcloud-kube-hetzner/#cni. 677 + # Also, see the cilium_values at towards the end of this file, in the advanced section (or use cilium_merge_values). 678 + # ⚠️ Depending on your setup, sometimes you need your control-planes to have more than 679 + # 2GB of RAM if you are going to use Cilium, otherwise the pods will not start. 680 + # cni_plugin = "cilium" 681 + 682 + # You can choose the version of Cilium that you want. By default we keep the version up to date and configure Cilium with compatible settings according to the version. 683 + # See https://github.com/cilium/cilium/releases for the available versions. 684 + # cilium_version = "v1.14.0" 685 + 686 + # Set native-routing mode ("native") or tunneling mode ("tunnel"). Default: tunnel 687 + # cilium_routing_mode = "native" 688 + 689 + # Used when Cilium is configured in native routing mode. The CNI assumes that the underlying network stack will forward packets to this destination without the need to apply SNAT. Default: value of "cluster_ipv4_cidr" 690 + # cilium_ipv4_native_routing_cidr = "10.0.0.0/8" 691 + 692 + # Enables egress gateway to redirect and SNAT the traffic that leaves the cluster. Default: false 693 + # cilium_egress_gateway_enabled = true 694 + 695 + # Enables Hubble Observability to collect and visualize network traffic. Default: false 696 + # cilium_hubble_enabled = true 697 + 698 + # Configures the list of Hubble metrics to collect. 699 + # cilium_hubble_metrics_enabled = [ 700 + # "policy:sourceContext=app|workload-name|pod|reserved-identity;destinationContext=app|workload-name|pod|dns|reserved-identity;labelsContext=source_namespace,destination_namespace" 701 + # ] 702 + 703 + # You can choose the version of Calico that you want. By default, the latest is used. 704 + # More info on available versions can be found at https://github.com/projectcalico/calico/releases 705 + # Please note that if you are getting 403s from Github, it's also useful to set the version manually. However there is rarely a need for that! 706 + # calico_version = "v3.27.2" 707 + 708 + # If you want to disable the k3s kube-proxy, use this flag. The default is "false". 709 + # Ensure that your CNI is capable of handling all the functionalities typically covered by kube-proxy. 710 + # disable_kube_proxy = true 711 + 712 + # If you want to disable the k3s default network policy controller, use this flag! 713 + # Both Calico and Cilium cni_plugin values override this value to true automatically, the default is "false". 714 + # disable_network_policy = true 715 + 716 + # If you want to disable the automatic use of placement group "spread". See https://docs.hetzner.com/cloud/placement-groups/overview/ 717 + # We advise to not touch that setting, unless you have a specific purpose. 718 + # The default is "false", meaning it's enabled by default. 719 + # placement_group_disable = true 720 + 721 + # By default, we allow ICMP ping in to the nodes, to check for liveness for instance. If you do not want to allow that, you can. Just set this flag to true (false by default). 722 + # block_icmp_ping_in = true 723 + 724 + # You can enable cert-manager (installed by Helm behind the scenes) with the following flag, the default is "true". 725 + # enable_cert_manager = false 726 + 727 + # IP Addresses to use for the DNS Servers, the defaults are the ones provided by Hetzner https://docs.hetzner.com/dns-console/dns/general/recursive-name-servers/. 728 + # The number of different DNS servers is limited to 3 by Kubernetes itself. 729 + # It's always a good idea to have at least 1 IPv4 and 1 IPv6 DNS server for robustness. 730 + dns_servers = [ 731 + "1.1.1.1", 732 + "8.8.8.8", 733 + "2606:4700:4700::1111", 734 + ] 735 + 736 + # When this is enabled, rather than the first node, all external traffic will be routed via a control-plane loadbalancer, allowing for high availability. 737 + # The default is false. 738 + use_control_plane_lb = false 739 + 740 + # When the above use_control_plane_lb is enabled, you can change the lb type for it, the default is "lb11". 741 + # control_plane_lb_type = "lb21" 742 + 743 + # When the above use_control_plane_lb is enabled, you can change to disable the public interface for control plane load balancer, the default is true. 744 + # control_plane_lb_enable_public_interface = false 745 + 746 + # Let's say you are not using the control plane LB solution above, and still want to have one hostname point to all your control-plane nodes. 747 + # You could create multiple A records of to let's say cp.cluster.my.org pointing to all of your control-plane nodes ips. 748 + # In which case, you need to define that hostname in the k3s TLS-SANs config to allow connection through it. It can be hostnames or IP addresses. 749 + # additional_tls_sans = ["cp.cluster.my.org"] 750 + 751 + # If you create a hostname with multiple A records pointing to all of your 752 + # control-plane nodes ips, you may want to use that hostname in the generated 753 + # kubeconfig. 754 + # kubeconfig_server_address = "cp.cluster.my.org" 755 + 756 + # lb_hostname Configuration: 757 + # 758 + # Purpose: 759 + # The lb_hostname setting optimizes communication between services within the Kubernetes cluster 760 + # when they use domain names instead of direct service names. By associating a domain name directly 761 + # with the Hetzner Load Balancer, this setting can help reduce potential communication delays. 762 + # 763 + # Scenario: 764 + # If Service B communicates with Service A using a domain (e.g., `a.mycluster.domain.com`) that points 765 + # to an external Load Balancer, there can be a slowdown in communication. 766 + # 767 + # Guidance: 768 + # - If your internal services use domain names pointing to an external LB, set lb_hostname to a domain 769 + # like `mycluster.domain.com`. 770 + # - Create an A record pointing `mycluster.domain.com` to your LB's IP. 771 + # - Create a CNAME record for `a.mycluster.domain.com` (or xyz.com) pointing to `mycluster.domain.com`. 772 + # 773 + # Technical Note: 774 + # This setting sets the `load-balancer.hetzner.cloud/hostname` in the Hetzner LB definition, suitable for 775 + # HAProxy, Nginx and Traefik ingress controllers. 776 + # 777 + # Recommendation: 778 + # This setting is optional. If services communicate using direct service names, you can leave this unset. 779 + # For inter-namespace communication, use `.service_name` as per Kubernetes norms. 780 + # 781 + # Example: 782 + # lb_hostname = "mycluster.domain.com" 783 + 784 + # You can enable Rancher (installed by Helm behind the scenes) with the following flag, the default is "false". 785 + # ⚠️ Rancher often doesn't support the latest Kubernetes version. You will need to set initial_k3s_channel to a supported version. 786 + # When Rancher is enabled, it automatically installs cert-manager too, and it uses rancher's own self-signed certificates. 787 + # See for options https://ranchermanager.docs.rancher.com/getting-started/installation-and-upgrade/install-upgrade-on-a-kubernetes-cluster#3-choose-your-ssl-configuration 788 + # The easiest thing is to leave everything as is (using the default rancher self-signed certificate) and put Cloudflare in front of it. 789 + # As for the number of replicas, by default it is set to the number of control plane nodes. 790 + # You can customized all of the above by adding a rancher_values variable see at the end of this file in the advanced section (or use rancher_merge_values). 791 + # After the cluster is deployed, you can always use HelmChartConfig definition to tweak the configuration. 792 + # IMPORTANT: Rancher's install is quite memory intensive, you will require at least 4GB if RAM, meaning cx23 server type (for your control plane). 793 + # ALSO, in order for Rancher to successfully deploy, you have to set the "rancher_hostname". 794 + # enable_rancher = true 795 + 796 + # If using Rancher you can set the Rancher hostname, it must be unique hostname even if you do not use it. 797 + # If not pointing the DNS, you can just port-forward locally via kubectl to get access to the dashboard. 798 + # If you already set the lb_hostname above and are using a Hetzner LB, you do not need to set this one, as it will be used by default. 799 + # But if you set this one explicitly, it will have preference over the lb_hostname in rancher settings. 800 + # rancher_hostname = "rancher.xyz.dev" 801 + 802 + # When Rancher is deployed, by default is uses the "latest" channel. But this can be customized. 803 + # The allowed values are "stable" or "latest". 804 + # rancher_install_channel = "stable" 805 + 806 + # Finally, you can specify a bootstrap-password for your rancher instance. Minimum 48 characters long! 807 + # If you leave empty, one will be generated for you. 808 + # (Can be used by another rancher2 provider to continue setup of rancher outside this module.) 809 + # rancher_bootstrap_password = "" 810 + 811 + # Separate from the above Rancher config (only use one or the other). You can import this cluster directly on an 812 + # an already active Rancher install. By clicking "import cluster" choosing "generic", giving it a name and pasting 813 + # the cluster registration url below. However, you can also ignore that and apply the url via kubectl as instructed 814 + # by Rancher in the wizard, and that would register your cluster too. 815 + # More information about the registration can be found here https://rancher.com/docs/rancher/v2.6/en/cluster-provisioning/registered-clusters/ 816 + # rancher_registration_manifest_url = "https://rancher.xyz.dev/v3/import/xxxxxxxxxxxxxxxxxxYYYYYYYYYYYYYYYYYYYzzzzzzzzzzzzzzzzzzzzz.yaml" 817 + 818 + # Extra commands to be executed after the `kubectl apply -k` (useful for post-install actions, e.g. wait for CRD, apply additional manifests, etc.). 819 + # extra_kustomize_deployment_commands="" 820 + 821 + # Extra values that will be passed to the `extra-manifests/kustomization.yaml.tpl` if its present. 822 + # extra_kustomize_parameters={} 823 + 824 + # See working examples for extra manifests or a HelmChart in examples/kustomization_user_deploy/README.md 825 + 826 + # It is best practice to turn this off, but for backwards compatibility it is set to "true" by default. 827 + # See https://github.com/kube-hetzner/terraform-hcloud-kube-hetzner/issues/349 828 + # When "false". The kubeconfig file can instead be created by executing: "terraform output --raw kubeconfig > cluster_kubeconfig.yaml" 829 + # Always be careful to not commit this file! 830 + create_kubeconfig = false 831 + 832 + # Don't create the kustomize backup. This can be helpful for automation. 833 + # create_kustomization = false 834 + 835 + # Export the values.yaml files used for the deployment of traefik, longhorn, cert-manager, etc. 836 + # This can be helpful to use them for later deployments like with ArgoCD. 837 + # The default is false. 838 + # export_values = true 839 + 840 + # MicroOS snapshot IDs to be used. Per default empty, the most recent image created using createkh will be used. 841 + # We recommend the default, but if you want to use specific IDs you can. 842 + # You can fetch the ids with the hcloud cli by running the "hcloud image list --selector 'microos-snapshot=yes'" command. 843 + # microos_x86_snapshot_id = "1234567" 844 + # microos_arm_snapshot_id = "1234567" 845 + 846 + ### ADVANCED - Custom helm values for packages above (search _values if you want to located where those are mentioned upper in this file) 847 + # ⚠️ Inside the _values variable below are examples, up to you to find out the best helm values possible, we do not provide support for customized helm values. 848 + # Please understand that the indentation is very important, inside the EOTs, as those are proper yaml helm values. 849 + # We advise you to use the default values, and only change them if you know what you are doing! 850 + 851 + # You can inline the values here in heredoc-style (as the examples below with the <<EOT to EOT). Please note that the current indentation inside the EOT is important. 852 + # Or you can create a thepackage-values.yaml file with the content and use it here with the following syntax: 853 + # thepackage_values = file("thepackage-values.yaml") 854 + # _values fully replaces the chart values used by the module. _merge_values keeps the defaults (or *_values if set) and overlays your YAML on top. 855 + 856 + # Cilium, all Cilium helm values can be found at https://github.com/cilium/cilium/blob/master/install/kubernetes/cilium/values.yaml 857 + # Be careful when maintaining your own cilium_values, as the choice of available settings depends on the Cilium version used. See also the cilium_version setting to fix a specific version. 858 + # If you want to merge extra values into defaults (or cilium_values), use cilium_merge_values. 859 + # The following is an example, please note that the current indentation inside the EOT is important. 860 + /* cilium_values = <<EOT 861 + 862 + ipam: 863 + mode: kubernetes 864 + k8s: 865 + requireIPv4PodCIDR: true 866 + kubeProxyReplacement: true 867 + routingMode: native 868 + ipv4NativeRoutingCIDR: "10.0.0.0/8" 869 + endpointRoutes: 870 + enabled: true 871 + loadBalancer: 872 + acceleration: native 873 + bpf: 874 + masquerade: true 875 + encryption: 876 + enabled: true 877 + type: wireguard 878 + MTU: 1450 879 + EOT */ 880 + 881 + /* cilium_merge_values = <<EOT 882 + encryption: 883 + enabled: true 884 + type: wireguard 885 + EOT */ 886 + 887 + # If you want to use a specific cert-manager helm chart version, set it below; otherwise, leave them as-is for the latest versions. 888 + # cert_manager_version = "" 889 + 890 + # Cert manager, all cert-manager helm values can be found at https://github.com/cert-manager/cert-manager/blob/master/deploy/charts/cert-manager/values.yaml 891 + # If you want to merge extra values into defaults (or cert_manager_values), use cert_manager_merge_values. 892 + # The following is an example, please note that the current indentation inside the EOT is important. 893 + # For cert-manager versions < v1.15.0, you need to set installCRDs: true instead of crds.enabled and crds.keep. 894 + /* cert_manager_values = <<EOT 895 + crds: 896 + enabled: true 897 + keep: true 898 + replicaCount: 3 899 + webhook: 900 + replicaCount: 3 901 + cainjector: 902 + replicaCount: 3 903 + EOT */ 904 + 905 + /* cert_manager_merge_values = <<EOT 906 + webhook: 907 + replicaCount: 2 908 + EOT */ 909 + 910 + # Hetzner Cloud Controller Manager, all Hetzner Cloud Controller Manager helm values can be found at https://github.com/hetznercloud/hcloud-cloud-controller-manager/blob/main/chart/values.yaml 911 + # We advise you to not touch this and to let the defaults that are already set under the hood. 912 + # If you want to merge extra values into defaults (or hetzner_ccm_values), use hetzner_ccm_merge_values. 913 + # For advanced use cases like adding Hetzner Robot servers, see: https://github.com/kube-hetzner/terraform-hcloud-kube-hetzner/blob/master/docs/add-robot-server.md 914 + # The following is an example, please note that the current indentation inside the EOT is important. 915 + /* hetzner_ccm_values = <<EOT 916 + networking: 917 + enabled: true 918 + args: 919 + cloud-provider: hcloud 920 + allow-untagged-cloud: "" 921 + route-reconciliation-period: 30s 922 + webhook-secure-port: "0" 923 + env: 924 + HCLOUD_LOAD_BALANCERS_LOCATION: 925 + value: "nbg1" 926 + HCLOUD_LOAD_BALANCERS_USE_PRIVATE_IP: 927 + value: "true" 928 + HCLOUD_LOAD_BALANCERS_ENABLED: 929 + value: "true" 930 + HCLOUD_LOAD_BALANCERS_DISABLE_PRIVATE_INGRESS: 931 + value: "true" 932 + EOT */ 933 + 934 + /* hetzner_ccm_merge_values = <<EOT 935 + env: 936 + HCLOUD_LOAD_BALANCERS_LOCATION: 937 + value: "nbg1" 938 + EOT */ 939 + 940 + # csi-driver-smb, all csi-driver-smb helm values can be found at https://github.com/kubernetes-csi/csi-driver-smb/blob/master/charts/latest/csi-driver-smb/values.yaml 941 + # The following is an example, please note that the current indentation inside the EOT is important. 942 + /* csi_driver_smb_values = <<EOT 943 + controller: 944 + name: csi-smb-controller 945 + replicas: 1 946 + runOnMaster: false 947 + runOnControlPlane: false 948 + resources: 949 + csiProvisioner: 950 + limits: 951 + memory: 300Mi 952 + requests: 953 + cpu: 10m 954 + memory: 20Mi 955 + livenessProbe: 956 + limits: 957 + memory: 100Mi 958 + requests: 959 + cpu: 10m 960 + memory: 20Mi 961 + smb: 962 + limits: 963 + memory: 200Mi 964 + requests: 965 + cpu: 10m 966 + memory: 20Mi 967 + EOT */ 968 + 969 + # Longhorn, all Longhorn helm values can be found at https://github.com/longhorn/longhorn/blob/master/chart/values.yaml 970 + # If you want to merge extra values into defaults (or longhorn_values), use longhorn_merge_values. 971 + # The following is an example, please note that the current indentation inside the EOT is important. 972 + /* longhorn_values = <<EOT 973 + defaultSettings: 974 + defaultDataPath: /var/longhorn 975 + persistence: 976 + defaultFsType: ext4 977 + defaultClassReplicaCount: 3 978 + defaultClass: true 979 + EOT */ 980 + 981 + /* longhorn_merge_values = <<EOT 982 + defaultSettings: 983 + defaultReplicaCount: 2 984 + EOT */ 985 + 986 + # If you want to use a specific Traefik helm chart version, set it below; otherwise, leave them as-is for the latest versions. 987 + # See https://github.com/traefik/traefik-helm-chart/releases for the available versions. 988 + # traefik_version = "" 989 + 990 + # Traefik, all Traefik helm values can be found at https://github.com/traefik/traefik-helm-chart/blob/master/traefik/values.yaml 991 + # If you want to merge extra values into defaults (or traefik_values), use traefik_merge_values. 992 + # The following is an example, please note that the current indentation inside the EOT is important. 993 + /* traefik_values = <<EOT 994 + deployment: 995 + replicas: 1 996 + globalArguments: [] 997 + service: 998 + enabled: true 999 + type: LoadBalancer 1000 + annotations: 1001 + "load-balancer.hetzner.cloud/name": "k3s" 1002 + "load-balancer.hetzner.cloud/use-private-ip": "true" 1003 + "load-balancer.hetzner.cloud/disable-private-ingress": "true" 1004 + "load-balancer.hetzner.cloud/location": "nbg1" 1005 + "load-balancer.hetzner.cloud/type": "lb11" 1006 + "load-balancer.hetzner.cloud/uses-proxyprotocol": "true" 1007 + 1008 + ports: 1009 + web: 1010 + redirections: 1011 + entryPoint: 1012 + to: websecure 1013 + scheme: https 1014 + permanent: true 1015 + 1016 + proxyProtocol: 1017 + trustedIPs: 1018 + - 127.0.0.1/32 1019 + - 10.0.0.0/8 1020 + forwardedHeaders: 1021 + trustedIPs: 1022 + - 127.0.0.1/32 1023 + - 10.0.0.0/8 1024 + websecure: 1025 + proxyProtocol: 1026 + trustedIPs: 1027 + - 127.0.0.1/32 1028 + - 10.0.0.0/8 1029 + forwardedHeaders: 1030 + trustedIPs: 1031 + - 127.0.0.1/32 1032 + - 10.0.0.0/8 1033 + EOT */ 1034 + 1035 + /* traefik_merge_values = <<EOT 1036 + service: 1037 + annotations: 1038 + "load-balancer.hetzner.cloud/location": "fsn1" 1039 + EOT */ 1040 + 1041 + # If you want to use a specific Nginx helm chart version, set it below; otherwise, leave them as-is for the latest versions. 1042 + # See https://github.com/kubernetes/ingress-nginx?tab=readme-ov-file#supported-versions-table for the available versions. 1043 + # nginx_version = "" 1044 + 1045 + # Nginx, all Nginx helm values can be found at https://github.com/kubernetes/ingress-nginx/blob/main/charts/ingress-nginx/values.yaml 1046 + # You can also have a look at https://kubernetes.github.io/ingress-nginx/, to understand how it works, and all the options at your disposal. 1047 + # If you want to merge extra values into defaults (or nginx_values), use nginx_merge_values. 1048 + # The following is an example, please note that the current indentation inside the EOT is important. 1049 + /* nginx_values = <<EOT 1050 + controller: 1051 + watchIngressWithoutClass: "true" 1052 + kind: "DaemonSet" 1053 + config: 1054 + "use-forwarded-headers": "true" 1055 + "compute-full-forwarded-for": "true" 1056 + "use-proxy-protocol": "true" 1057 + service: 1058 + annotations: 1059 + "load-balancer.hetzner.cloud/name": "k3s" 1060 + "load-balancer.hetzner.cloud/use-private-ip": "true" 1061 + "load-balancer.hetzner.cloud/disable-private-ingress": "true" 1062 + "load-balancer.hetzner.cloud/location": "nbg1" 1063 + "load-balancer.hetzner.cloud/type": "lb11" 1064 + "load-balancer.hetzner.cloud/uses-proxyprotocol": "true" 1065 + EOT */ 1066 + 1067 + /* nginx_merge_values = <<EOT 1068 + controller: 1069 + kind: "Deployment" 1070 + EOT */ 1071 + 1072 + # If you want to use a specific HAProxy helm chart version, set it below; otherwise, leave them as-is for the latest versions. 1073 + # haproxy_version = "" 1074 + 1075 + # If you want to configure additional proxy protocol trusted IPs for haproxy, enter them here as a list of IPs (strings). 1076 + # Example for Cloudflare: 1077 + # haproxy_additional_proxy_protocol_ips = [ 1078 + # "173.245.48.0/20", 1079 + # "103.21.244.0/22", 1080 + # "103.22.200.0/22", 1081 + # "103.31.4.0/22", 1082 + # "141.101.64.0/18", 1083 + # "108.162.192.0/18", 1084 + # "190.93.240.0/20", 1085 + # "188.114.96.0/20", 1086 + # "197.234.240.0/22", 1087 + # "198.41.128.0/17", 1088 + # "162.158.0.0/15", 1089 + # "104.16.0.0/13", 1090 + # "104.24.0.0/14", 1091 + # "172.64.0.0/13", 1092 + # "131.0.72.0/22", 1093 + # "2400:cb00::/32", 1094 + # "2606:4700::/32", 1095 + # "2803:f800::/32", 1096 + # "2405:b500::/32", 1097 + # "2405:8100::/32", 1098 + # "2a06:98c0::/29", 1099 + # "2c0f:f248::/32" 1100 + # ] 1101 + 1102 + # Configure CPU and memory requests for each HAProxy pod 1103 + # haproxy_requests_cpu = "250m" 1104 + # haproxy_requests_memory = "400Mi" 1105 + 1106 + # Override values given to the HAProxy helm chart. 1107 + # All HAProxy helm values can be found at https://github.com/haproxytech/helm-charts/blob/main/kubernetes-ingress/values.yaml 1108 + # Default values can be found at https://github.com/kube-hetzner/terraform-hcloud-kube-hetzner/blob/master/locals.tf 1109 + # If you want to merge extra values into defaults (or haproxy_values), use haproxy_merge_values. 1110 + /* haproxy_values = <<EOT 1111 + EOT */ 1112 + 1113 + /* haproxy_merge_values = <<EOT 1114 + controller: 1115 + replicaCount: 2 1116 + EOT */ 1117 + 1118 + # Rancher, all Rancher helm values can be found at https://rancher.com/docs/rancher/v2.5/en/installation/install-rancher-on-k8s/chart-options/ 1119 + # If you want to merge extra values into defaults (or rancher_values), use rancher_merge_values. 1120 + # The following is an example, please note that the current indentation inside the EOT is important. 1121 + /* rancher_values = <<EOT 1122 + ingress: 1123 + tls: 1124 + source: "rancher" 1125 + hostname: "rancher.example.com" 1126 + replicas: 1 1127 + bootstrapPassword: "supermario" 1128 + EOT */ 1129 + 1130 + /* rancher_merge_values = <<EOT 1131 + replicas: 3 1132 + EOT */ 1133 + 1134 + } 1135 + 1136 + provider "hcloud" { 1137 + token = var.hcloud_token != "" ? var.hcloud_token : local.hcloud_token 1138 + } 1139 + 1140 + terraform { 1141 + required_version = ">= 1.5.0" 1142 + required_providers { 1143 + hcloud = { 1144 + source = "hetznercloud/hcloud" 1145 + version = ">= 1.51.0" 1146 + } 1147 + } 1148 + } 1149 + 1150 + output "kubeconfig" { 1151 + value = module.kube-hetzner.kubeconfig 1152 + sensitive = true 1153 + } 1154 + 1155 + variable "hcloud_token" { 1156 + sensitive = true 1157 + default = "" 1158 + }
tub_kubeconfig.yaml

This is a binary file and will not be displayed.