diff --git a/README.md b/README.md index 256b510..59a8c19 100644 --- a/README.md +++ b/README.md @@ -69,21 +69,20 @@ and check the access by viewing the created cluster nodes: ```cmd $ kubectl get nodes --kubeconfig=kubeconfig.conf NAME STATUS ROLES AGE VERSION -k8s-control-plane-0 Ready control-plane 31m v1.29.2 -k8s-worker-0 Ready 31m v1.29.2 -k8s-worker-1 Ready 31m v1.29.2 +k8s-control-plane-0 Ready control-plane 31m v1.31.1 +k8s-worker-0 Ready 31m v1.31.1 +k8s-worker-1 Ready 31m v1.31.1 ``` ## Supported base images The module should work on most major RPM and DEB distros. It been tested on these base images: -- Ubuntu 22.04 (`ubuntu-22.04`) +- Ubuntu 24.04 (`ubuntu-24.04`) - Debian 12 (`debian-12`) - Centos Stream 9 (`centos-stream-9`) - Rocky Linux 9 (`rocky-9`) -- Fedora 38 (`fedora-38`) -- Fedora 39 (`fedora-39`) +- Fedora 40 (`fedora-40`) Others may work as well, but have not been tested. diff --git a/examples/cloud_init.tf b/examples/cloud_init.tf index 33f3f77..9b34b81 100644 --- a/examples/cloud_init.tf +++ b/examples/cloud_init.tf @@ -27,7 +27,7 @@ module "cluster" { hcloud_ssh_key = hcloud_ssh_key.key.id hcloud_token = vars.hetzner_token location = "hel1" - server_type = "cx31" + server_type = "cpx31" } // After control plane is set up, additional workers can be joined @@ -37,7 +37,7 @@ resource "hcloud_server" "instance" { ssh_keys = [hcloud_ssh_key.key.id] image = "ubuntu-20.04" location = "hel1" - server_type = "cx31" + server_type = "cpx31" user_data = module.cluster.join_user_data } diff --git a/examples/private_network.tf b/examples/private_network.tf index 6753e25..c770b52 100644 --- a/examples/private_network.tf +++ b/examples/private_network.tf @@ -27,7 +27,7 @@ module "cluster" { hcloud_ssh_key = hcloud_ssh_key.key.id hcloud_token = vars.hetzner_token location = "hel1" - server_type = "cx31" + server_type = "cpx31" # The default pod_cidr_ipv6 is 10.96.0.0/16. This can be customized, # but it should be within the range of the private network. Also, it should @@ -49,7 +49,7 @@ module "workers" { hcloud_ssh_key = hcloud_ssh_key.key.id location = "hel1" - server_type = "cx31" + server_type = "cpx31" use_hcloud_network = true hcloud_network_id = hcloud_network.my_net.id diff --git a/examples/simple.tf b/examples/simple.tf index 18dcc40..fb9dad8 100644 --- a/examples/simple.tf +++ b/examples/simple.tf @@ -27,7 +27,7 @@ module "cluster" { hcloud_ssh_key = hcloud_ssh_key.key.id hcloud_token = vars.hetzner_token location = "hel1" - server_type = "cx31" + server_type = "cpx31" } module "workers" { @@ -40,7 +40,7 @@ module "workers" { hcloud_ssh_key = hcloud_ssh_key.key.id location = "hel1" - server_type = "cx31" + server_type = "cpx31" } output "simple_kubeconfig" { diff --git a/modules/kubernetes-node/scripts/prepare-node.sh.tpl b/modules/kubernetes-node/scripts/prepare-node.sh.tpl index 5708767..8036bd1 100755 --- a/modules/kubernetes-node/scripts/prepare-node.sh.tpl +++ b/modules/kubernetes-node/scripts/prepare-node.sh.tpl @@ -111,11 +111,7 @@ install_kubernetes() { apt-get -qq install kubelet=${kubernetes_version}-* kubeadm=${kubernetes_version}-* kubectl=${kubernetes_version}-* apt-mark hold kubelet kubeadm kubectl - mkdir -p /etc/systemd/system/kubelet.service.d - cat <<-EOF > /etc/systemd/system/kubelet.service.d/20-hcloud.conf - [Service] - Environment="KUBELET_EXTRA_ARGS=--cloud-provider=external --node-ip=::" - EOF + echo 'KUBELET_EXTRA_ARGS=--cloud-provider=external --node-ip=::' > /etc/default/kubelet systemctl daemon-reload systemctl restart containerd kubelet diff --git a/modules/worker-node/variables.tf b/modules/worker-node/variables.tf index 6dfcad3..114de71 100644 --- a/modules/worker-node/variables.tf +++ b/modules/worker-node/variables.tf @@ -13,15 +13,15 @@ variable "hcloud_ssh_key" { } variable "server_type" { - description = "Server SKU (default: 'cx31')" + description = "Server SKU (default: 'cpx31')" type = string - default = "cx31" + default = "cpx31" } variable "image" { - description = "Image for the nodes (default: ubuntu-22.04)" + description = "Image for the nodes (default: ubuntu-24.04)" type = string - default = "ubuntu-22.04" + default = "ubuntu-24.04" } variable "location" { @@ -51,7 +51,7 @@ variable "labels" { variable "kubernetes_version" { description = "Kubernetes version" type = string - default = "1.29.2" + default = "1.31.1" validation { condition = can(regex("^1\\.([0-9]+)\\.([0-9]+)$", var.kubernetes_version)) diff --git a/templates/hetzner_ccm.yaml.tpl b/templates/hetzner_ccm.yaml.tpl index d6f9b3d..3ecb3a5 100644 --- a/templates/hetzner_ccm.yaml.tpl +++ b/templates/hetzner_ccm.yaml.tpl @@ -90,7 +90,7 @@ spec: %{ endif ~} - name: HCLOUD_INSTANCES_ADDRESS_FAMILY value: dualstack - image: hetznercloud/hcloud-cloud-controller-manager:v1.19.0 # x-release-please-version + image: docker.io/hetznercloud/hcloud-cloud-controller-manager:v1.20.0 # x-release-please-version ports: - name: metrics containerPort: 8233 diff --git a/templates/hetzner_csi.yaml.tpl b/templates/hetzner_csi.yaml.tpl index 285c72f..9456b36 100644 --- a/templates/hetzner_csi.yaml.tpl +++ b/templates/hetzner_csi.yaml.tpl @@ -186,7 +186,7 @@ spec: initContainers: containers: - name: csi-node-driver-registrar - image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.7.0 + image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.11.1 imagePullPolicy: IfNotPresent args: - --kubelet-registration-path=/var/lib/kubelet/plugins/csi.hetzner.cloud/socket @@ -199,7 +199,7 @@ spec: limits: {} requests: {} - name: liveness-probe - image: registry.k8s.io/sig-storage/livenessprobe:v2.9.0 + image: registry.k8s.io/sig-storage/livenessprobe:v2.13.1 imagePullPolicy: IfNotPresent volumeMounts: - mountPath: /run/csi @@ -208,7 +208,7 @@ spec: limits: {} requests: {} - name: hcloud-csi-driver - image: docker.io/hetznercloud/hcloud-csi-driver:v2.6.0 # x-release-please-version + image: docker.io/hetznercloud/hcloud-csi-driver:v2.9.0 # x-release-please-version imagePullPolicy: IfNotPresent command: [/bin/hcloud-csi-driver-node] volumeMounts: @@ -297,7 +297,7 @@ spec: initContainers: containers: - name: csi-attacher - image: registry.k8s.io/sig-storage/csi-attacher:v4.1.0 + image: registry.k8s.io/sig-storage/csi-attacher:v4.6.1 imagePullPolicy: IfNotPresent resources: limits: {} @@ -309,7 +309,7 @@ spec: mountPath: /run/csi - name: csi-resizer - image: registry.k8s.io/sig-storage/csi-resizer:v1.7.0 + image: registry.k8s.io/sig-storage/csi-resizer:v1.11.2 imagePullPolicy: IfNotPresent resources: limits: {} @@ -319,7 +319,7 @@ spec: mountPath: /run/csi - name: csi-provisioner - image: registry.k8s.io/sig-storage/csi-provisioner:v3.4.0 + image: registry.k8s.io/sig-storage/csi-provisioner:v5.0.2 imagePullPolicy: IfNotPresent resources: limits: {} @@ -332,7 +332,7 @@ spec: mountPath: /run/csi - name: liveness-probe - image: registry.k8s.io/sig-storage/livenessprobe:v2.9.0 + image: registry.k8s.io/sig-storage/livenessprobe:v2.13.1 imagePullPolicy: IfNotPresent resources: limits: {} @@ -342,7 +342,7 @@ spec: name: socket-dir - name: hcloud-csi-driver - image: docker.io/hetznercloud/hcloud-csi-driver:v2.6.0 # x-release-please-version + image: docker.io/hetznercloud/hcloud-csi-driver:v2.9.0 # x-release-please-version imagePullPolicy: IfNotPresent command: [/bin/hcloud-csi-driver-controller] env: diff --git a/templates/kubeadm.yaml.tpl b/templates/kubeadm.yaml.tpl index 5c43137..f9d1926 100644 --- a/templates/kubeadm.yaml.tpl +++ b/templates/kubeadm.yaml.tpl @@ -3,14 +3,14 @@ apiVersion: kubelet.config.k8s.io/v1beta1 cgroupDriver: systemd --- kind: InitConfiguration -apiVersion: kubeadm.k8s.io/v1beta3 +apiVersion: kubeadm.k8s.io/v1beta4 certificateKey: "${certificate_key}" localAPIEndpoint: advertiseAddress: "${advertise_address}" bindPort: 6443 --- kind: ClusterConfiguration -apiVersion: kubeadm.k8s.io/v1beta3 +apiVersion: kubeadm.k8s.io/v1beta4 kubernetesVersion: "v${kubernetes_version}" apiServer: certSANs: diff --git a/test/main.tf b/test/main.tf index a3795c4..e4dba89 100644 --- a/test/main.tf +++ b/test/main.tf @@ -26,7 +26,7 @@ module "simple_cluster" { hcloud_ssh_key = hcloud_ssh_key.key.id hcloud_token = var.hetzner_token location = "hel1" - server_type = "cx21" + server_type = "cpx21" } module "simple_worker_node" { @@ -38,7 +38,7 @@ module "simple_worker_node" { hcloud_ssh_key = hcloud_ssh_key.key.id location = "hel1" - server_type = "cx21" + server_type = "cpx21" } module "ha_cluster" { @@ -48,7 +48,7 @@ module "ha_cluster" { hcloud_ssh_key = hcloud_ssh_key.key.id hcloud_token = var.hetzner_token location = "hel1" - server_type = "cx21" + server_type = "cpx21" load_balancer_type = "lb11" @@ -64,7 +64,7 @@ module "ha_worker_node" { hcloud_ssh_key = hcloud_ssh_key.key.id location = "hel1" - server_type = "cx21" + server_type = "cpx21" } diff --git a/variables.tf b/variables.tf index ffdbccc..80cbfea 100644 --- a/variables.tf +++ b/variables.tf @@ -9,9 +9,9 @@ variable "hcloud_ssh_key" { } variable "server_type" { - description = "Server SKU for control plane nodes (default: 'cx31')" + description = "Server SKU for control plane nodes (default: 'cpx31')" type = string - default = "cx31" + default = "cpx31" } variable "hcloud_token" { @@ -57,9 +57,9 @@ variable "service_cidr_ipv4" { } variable "image" { - description = "Image for the nodes (default: ubuntu-22.04)" + description = "Image for the nodes (default: ubuntu-24.04)" type = string - default = "ubuntu-22.04" + default = "ubuntu-24.04" } variable "location" { @@ -116,9 +116,9 @@ variable "primary_ip_family" { } variable "kubernetes_version" { - description = "Version of Kubernetes to install (default: 1.29.2)" + description = "Version of Kubernetes to install (default: 1.31.1)" type = string - default = "1.29.2" + default = "1.31.1" validation { condition = can(regex("^1\\.([0-9]+)\\.([0-9]+)$", var.kubernetes_version))