Skip to content

Commit 1be5874

Browse files
committed
chore: update hetzner configuration
Update the example Packer and Terraform configuration. - Remove "wait" from talos_cluster_kubeconfig - Update Talos version from v1.3.0 to v1.6.0 - Update Hetzner server types - Update Hetzner Terraform provider - Set talos_version and kubernetes_version Signed-off-by: Andrew Longwill <[email protected]>
1 parent b14dd77 commit 1be5874

File tree

8 files changed

+72
-54
lines changed

8 files changed

+72
-54
lines changed

examples/terraform/basic/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,4 @@ resource "talos_cluster_kubeconfig" "this" {
5858
depends_on = [talos_machine_bootstrap.this]
5959
client_configuration = talos_machine_secrets.this.client_configuration
6060
node = [for k, v in var.node_data.controlplanes : k][0]
61-
wait = true
6261
}

examples/terraform/hcloud/packer/hcloud_talosimage.pkr.hcl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ packer {
1111

1212
variable "talos_version" {
1313
type = string
14-
default = "v1.3.0"
14+
default = "v1.6.0"
1515
}
1616

1717
locals {
@@ -20,9 +20,9 @@ locals {
2020

2121
source "hcloud" "talos" {
2222
rescue = "linux64"
23-
image = "debian-11"
23+
image = "debian-12"
2424
location = "fsn1"
25-
server_type = "cx11"
25+
server_type = "cx22"
2626
ssh_username = "root"
2727

2828
snapshot_name = "talos system disk ${var.talos_version}"

examples/terraform/hcloud/terraform/.terraform.lock.hcl

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/terraform/hcloud/terraform/README.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
| Name | Version |
55
|------|---------|
6-
| <a name="requirement_hcloud"></a> [hcloud](#requirement\_hcloud) | 1.35.2 |
6+
| <a name="requirement_hcloud"></a> [hcloud](#requirement\_hcloud) | 1.48.1 |
77
| <a name="requirement_talos"></a> [talos](#requirement\_talos) | 0.6.0-beta.0 |
88

99
## Providers
1010

1111
| Name | Version |
1212
|------|---------|
13-
| <a name="provider_hcloud"></a> [hcloud](#provider\_hcloud) | 1.35.2 |
13+
| <a name="provider_hcloud"></a> [hcloud](#provider\_hcloud) | 1.48.1 |
1414
| <a name="provider_talos"></a> [talos](#provider\_talos) | 0.6.0-beta.0 |
1515

1616
## Modules
@@ -21,17 +21,17 @@ No modules.
2121

2222
| Name | Type |
2323
|------|------|
24-
| [hcloud_load_balancer.controlplane_load_balancer](https://registry.terraform.io/providers/hetznercloud/hcloud/1.35.2/docs/resources/load_balancer) | resource |
25-
| [hcloud_load_balancer_network.srvnetwork](https://registry.terraform.io/providers/hetznercloud/hcloud/1.35.2/docs/resources/load_balancer_network) | resource |
26-
| [hcloud_load_balancer_service.controlplane_load_balancer_service_kubectl](https://registry.terraform.io/providers/hetznercloud/hcloud/1.35.2/docs/resources/load_balancer_service) | resource |
27-
| [hcloud_load_balancer_service.controlplane_load_balancer_service_mayastor](https://registry.terraform.io/providers/hetznercloud/hcloud/1.35.2/docs/resources/load_balancer_service) | resource |
28-
| [hcloud_load_balancer_service.controlplane_load_balancer_service_talosctl](https://registry.terraform.io/providers/hetznercloud/hcloud/1.35.2/docs/resources/load_balancer_service) | resource |
29-
| [hcloud_load_balancer_target.load_balancer_target](https://registry.terraform.io/providers/hetznercloud/hcloud/1.35.2/docs/resources/load_balancer_target) | resource |
30-
| [hcloud_network.network](https://registry.terraform.io/providers/hetznercloud/hcloud/1.35.2/docs/resources/network) | resource |
31-
| [hcloud_network_subnet.subnet](https://registry.terraform.io/providers/hetznercloud/hcloud/1.35.2/docs/resources/network_subnet) | resource |
32-
| [hcloud_server.controlplane_server](https://registry.terraform.io/providers/hetznercloud/hcloud/1.35.2/docs/resources/server) | resource |
33-
| [hcloud_server.worker_server](https://registry.terraform.io/providers/hetznercloud/hcloud/1.35.2/docs/resources/server) | resource |
34-
| [hcloud_volume.volumes](https://registry.terraform.io/providers/hetznercloud/hcloud/1.35.2/docs/resources/volume) | resource |
24+
| [hcloud_load_balancer.controlplane_load_balancer](https://registry.terraform.io/providers/hetznercloud/hcloud/1.48.1/docs/resources/load_balancer) | resource |
25+
| [hcloud_load_balancer_network.srvnetwork](https://registry.terraform.io/providers/hetznercloud/hcloud/1.48.1/docs/resources/load_balancer_network) | resource |
26+
| [hcloud_load_balancer_service.controlplane_load_balancer_service_kubectl](https://registry.terraform.io/providers/hetznercloud/hcloud/1.48.1/docs/resources/load_balancer_service) | resource |
27+
| [hcloud_load_balancer_service.controlplane_load_balancer_service_mayastor](https://registry.terraform.io/providers/hetznercloud/hcloud/1.48.1/docs/resources/load_balancer_service) | resource |
28+
| [hcloud_load_balancer_service.controlplane_load_balancer_service_talosctl](https://registry.terraform.io/providers/hetznercloud/hcloud/1.48.1/docs/resources/load_balancer_service) | resource |
29+
| [hcloud_load_balancer_target.load_balancer_target](https://registry.terraform.io/providers/hetznercloud/hcloud/1.48.1/docs/resources/load_balancer_target) | resource |
30+
| [hcloud_network.network](https://registry.terraform.io/providers/hetznercloud/hcloud/1.48.1/docs/resources/network) | resource |
31+
| [hcloud_network_subnet.subnet](https://registry.terraform.io/providers/hetznercloud/hcloud/1.48.1/docs/resources/network_subnet) | resource |
32+
| [hcloud_server.controlplane_server](https://registry.terraform.io/providers/hetznercloud/hcloud/1.48.1/docs/resources/server) | resource |
33+
| [hcloud_server.worker_server](https://registry.terraform.io/providers/hetznercloud/hcloud/1.48.1/docs/resources/server) | resource |
34+
| [hcloud_volume.volumes](https://registry.terraform.io/providers/hetznercloud/hcloud/1.48.1/docs/resources/volume) | resource |
3535
| [talos_cluster_kubeconfig.this](https://registry.terraform.io/providers/siderolabs/talos/0.6.0-beta.0/docs/resources/cluster_kubeconfig) | resource |
3636
| [talos_machine_bootstrap.bootstrap](https://registry.terraform.io/providers/siderolabs/talos/0.6.0-beta.0/docs/resources/machine_bootstrap) | resource |
3737
| [talos_machine_secrets.this](https://registry.terraform.io/providers/siderolabs/talos/0.6.0-beta.0/docs/resources/machine_secrets) | resource |
@@ -45,14 +45,16 @@ No modules.
4545
|------|-------------|------|---------|:--------:|
4646
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | A name to provide for the Talos cluster | `string` | `"talos-hloud-cluster"` | no |
4747
| <a name="input_controlplane_ip"></a> [controlplane\_ip](#input\_controlplane\_ip) | n/a | `string` | `"10.0.0.3"` | no |
48-
| <a name="input_controlplane_type"></a> [controlplane\_type](#input\_controlplane\_type) | Control plane | `string` | `"cpx31"` | no |
48+
| <a name="input_controlplane_type"></a> [controlplane\_type](#input\_controlplane\_type) | Control plane | `string` | `"cx32"` | no |
4949
| <a name="input_image_id"></a> [image\_id](#input\_image\_id) | Talos specific variables | `string` | n/a | yes |
50+
| <a name="input_kubernetes_version"></a> [kubernetes\_version](#input\_kubernetes\_version) | Kubernetes version to use for the cluster, if not set the k8s version shipped with the talos sdk version will be used | `string` | `null` | no |
5051
| <a name="input_load_balancer_type"></a> [load\_balancer\_type](#input\_load\_balancer\_type) | n/a | `string` | `"lb11"` | no |
5152
| <a name="input_location"></a> [location](#input\_location) | Workers | `string` | `"fsn1"` | no |
5253
| <a name="input_network_zone"></a> [network\_zone](#input\_network\_zone) | Load balancer | `string` | `"eu-central"` | no |
5354
| <a name="input_private_network_ip_range"></a> [private\_network\_ip\_range](#input\_private\_network\_ip\_range) | n/a | `string` | `"10.0.0.0/16"` | no |
5455
| <a name="input_private_network_name"></a> [private\_network\_name](#input\_private\_network\_name) | Networking | `string` | `"talos-network"` | no |
5556
| <a name="input_private_network_subnet_range"></a> [private\_network\_subnet\_range](#input\_private\_network\_subnet\_range) | n/a | `string` | `"10.0.0.0/24"` | no |
57+
| <a name="input_talos_version_contract"></a> [talos\_version\_contract](#input\_talos\_version\_contract) | Talos API version to use for the cluster, if not set the the version shipped with the talos sdk version will be used | `string` | `"v1.6"` | no |
5658
| <a name="input_worker_extra_volume_size"></a> [worker\_extra\_volume\_size](#input\_worker\_extra\_volume\_size) | Size of SSD volume to attach to workers | `number` | `10` | no |
5759
| <a name="input_workers"></a> [workers](#input\_workers) | Worker definition | `any` | n/a | yes |
5860

examples/terraform/hcloud/terraform/main.tf

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,18 @@ resource "hcloud_load_balancer_service" "controlplane_load_balancer_service_maya
6262

6363
# Talos
6464
# create the machine secrets
65-
resource "talos_machine_secrets" "this" {}
65+
resource "talos_machine_secrets" "this" {
66+
talos_version = var.talos_version_contract
67+
}
6668

6769
# create the controlplane config, using the loadbalancer as cluster endpoint
6870
data "talos_machine_configuration" "controlplane" {
69-
cluster_name = var.cluster_name
70-
cluster_endpoint = "https://${hcloud_load_balancer.controlplane_load_balancer.ipv4}:6443"
71-
machine_type = "controlplane"
72-
machine_secrets = talos_machine_secrets.this.machine_secrets
71+
cluster_name = var.cluster_name
72+
cluster_endpoint = "https://${hcloud_load_balancer.controlplane_load_balancer.ipv4}:6443"
73+
machine_type = "controlplane"
74+
machine_secrets = talos_machine_secrets.this.machine_secrets
75+
talos_version = var.talos_version_contract
76+
kubernetes_version = var.kubernetes_version
7377
config_patches = [
7478
templatefile("${path.module}/templates/controlplanepatch.yaml.tmpl", {
7579
loadbalancerip = hcloud_load_balancer.controlplane_load_balancer.ipv4, subnet = var.private_network_subnet_range
@@ -117,10 +121,12 @@ resource "talos_machine_bootstrap" "bootstrap" {
117121

118122
# create the worker config and apply the worker patch
119123
data "talos_machine_configuration" "worker" {
120-
cluster_name = var.cluster_name
121-
cluster_endpoint = "https://${hcloud_load_balancer.controlplane_load_balancer.ipv4}:6443"
122-
machine_type = "worker"
123-
machine_secrets = talos_machine_secrets.this.machine_secrets
124+
cluster_name = var.cluster_name
125+
cluster_endpoint = "https://${hcloud_load_balancer.controlplane_load_balancer.ipv4}:6443"
126+
machine_type = "worker"
127+
machine_secrets = talos_machine_secrets.this.machine_secrets
128+
talos_version = var.talos_version_contract
129+
kubernetes_version = var.kubernetes_version
124130
config_patches = [
125131
templatefile("${path.module}/templates/workerpatch.yaml.tmpl", {
126132
subnet = var.private_network_subnet_range
@@ -164,5 +170,4 @@ resource "hcloud_volume" "volumes" {
164170
resource "talos_cluster_kubeconfig" "this" {
165171
client_configuration = talos_machine_secrets.this.client_configuration
166172
node = hcloud_server.controlplane_server.ipv4_address
167-
wait = true
168173
}

examples/terraform/hcloud/terraform/three_workers.tfvars

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
workers = {
22
1 = {
3-
server_type = "cpx31",
3+
server_type = "cx32",
44
name = "talos-worker-1",
55
location = "fsn1",
66
labels = { "type" : "talos-worker" },
77
taints = [],
88
},
99
2 = {
10-
server_type = "cpx31",
10+
server_type = "cx32",
1111
name = "talos-worker-2",
1212
location = "fsn1",
1313
labels = { "type" : "talos-worker" },
1414
taints = [],
1515
},
1616
3 = {
17-
server_type = "cpx31",
17+
server_type = "cx32",
1818
name = "talos-worker-3",
1919
location = "fsn1",
2020
labels = { "type" : "talos-worker" },

examples/terraform/hcloud/terraform/variables.tf

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,21 @@ variable "cluster_name" {
99
default = "talos-hloud-cluster"
1010
}
1111

12+
variable "talos_version_contract" {
13+
description = "Talos API version to use for the cluster, if not set the the version shipped with the talos sdk version will be used"
14+
type = string
15+
default = "v1.6"
16+
}
17+
18+
variable "kubernetes_version" {
19+
description = "Kubernetes version to use for the cluster, if not set the k8s version shipped with the talos sdk version will be used"
20+
type = string
21+
default = null
22+
}
23+
1224
# Control plane
1325
variable "controlplane_type" {
14-
default = "cpx31"
26+
default = "cx32"
1527
}
1628

1729
variable "controlplane_ip" {
@@ -51,7 +63,7 @@ variable "workers" {
5163
}
5264

5365
variable "worker_extra_volume_size" {
54-
description = " Size of SSD volume to attach to workers"
66+
description = "Size of SSD volume to attach to workers"
5567
type = number
5668
default = 10
5769
}

examples/terraform/hcloud/terraform/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
hcloud = {
66
source = "hetznercloud/hcloud"
7-
version = "1.35.2"
7+
version = "1.48.1"
88
}
99
talos = {
1010
source = "siderolabs/talos"

0 commit comments

Comments
 (0)