Simplify server and agent definition for kubernetes

The definition was split into multiple settings, that made it
unnecessary complicated to setup the definition for my kubernetes
cluster. This new approach allows for granular definitions of servers
and agents and is also simpler to use for me.
This commit is contained in:
2025-10-17 13:02:59 +02:00
parent 58b0c0fcc7
commit b33da3eca0
2 changed files with 20 additions and 41 deletions

12
main.tf
View File

@@ -9,16 +9,8 @@ module "k8s" {
name = "cluster1"
ssh_keys = [for o in hcloud_ssh_key.this : o.id]
servers = [for n in range(var.k8s_server_count) : {
type = var.k8s_server_type
location = var.k8s_location
ip_datacenter = var.k8s_ip_datacenter
}]
agents = [{
type = var.k8s_agent_type
location = var.k8s_location
count = var.k8s_agent_count
}]
servers = var.k8s_servers
agents = var.k8s_agents
auto_delete_primary_ips = false
kubernetes_exposed_ips = var.kubernetes_allowed_ips
ssh_exposed_ips = var.ssh_allowed_ips