diff --git a/.gitignore b/.gitignore index 65bfb30..a634978 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .terraform* terraform.tfstate* -.env \ No newline at end of file +.env +kubeconfig* \ No newline at end of file diff --git a/example/main.tf b/example/main.tf index 9265f10..1f66eb9 100644 --- a/example/main.tf +++ b/example/main.tf @@ -25,10 +25,6 @@ module "stackit_ske_cluster" { project_id = local.project_ids[each.value.project_key] name = each.value.name node_pools = each.value.node_pools - network = { - id = each.value.network_id - } - kubernetes_version_min = lookup(each.value, "kubernetes_version_min", null) hibernations = lookup(each.value, "hibernations", null) maintenance = lookup(each.value, "maintenance", null) @@ -131,4 +127,4 @@ output "obs_url" { for key, instance in module.observability : key => instance.observability_urls } -} \ No newline at end of file +} diff --git a/example/terraform.tfvars b/example/terraform.tfvars index 1fd2f83..9b09f84 100644 --- a/example/terraform.tfvars +++ b/example/terraform.tfvars @@ -2,16 +2,16 @@ organization_id = "03a34540-3c1a-4794-b2c6-7111ecf824ef" Projects_map = { "projekt-alpha" = { - name = "tf_modules_test_3_max" + name = "tf_modules_test_6_jh" owner_email = "maximilian.schlenz@stackit.cloud" }, "projekt-beta" = { - name = "tf_modules_test_4_max" + name = "tf_modules_test_7_jh" owner_email = "maximilian.schlenz@stackit.cloud" } } -SNA_name = "sna-tf_modules_test" +SNA_name = "sna-jh" SNA_network_ranges = [ { prefix = "192.168.10.0/24" } @@ -111,60 +111,12 @@ postgres_instances = { networks = { wan_network = { name = "wan_network" - project_key = "projekt-alpha" + project_key = "projekt-beta" ipv4_nameservers = ["1.1.1.1", "8.8.8.8"] - ipv4_prefix_length = 24 - ipv4_prefix = "192.168.10.0/27" + ipv4_prefix_length = 29 + ipv4_prefix = "192.168.10.248/29" routed = true } - lan_network1 = { - name = "lan_network1" - project_key = "projekt-alpha" - ipv4_nameservers = ["1.1.1.1", "8.8.8.8"] - ipv4_prefix_length = 24 - ipv4_prefix = "192.168.10.32/27" - routed = true - nics = { - p2_lan1 = { - nic_name = "P2LAN1" - nic_ipv4 = "192.168.10.33" - nic_security = true - nic_security_group_names = ["ssh-ingress-group"] - } - } - } - lan_network2 = { - name = "lan_network2" - project_key = "projekt-alpha" - ipv4_nameservers = ["1.1.1.1", "8.8.8.8"] - ipv4_prefix_length = 24 - ipv4_prefix = "192.168.10.64/27" - routed = true - } - lan_network3 = { - name = "lan_network3" - project_key = "projekt-alpha" - ipv4_nameservers = ["1.1.1.1", "8.8.8.8"] - ipv4_prefix_length = 24 - ipv4_prefix = "192.168.10.96/27" - routed = true - } - wan = { - name = "MGMT" - project_key = "projekt-alpha" - ipv4_nameservers = ["1.1.1.1", "8.8.8.8"] - ipv4_prefix_length = 24 - ipv4_prefix = "192.168.10.128/27" - nic_ipv4 = "192.168.10.254" - } - - db = { - name = "db-net" - project_key = "projekt-alpha" - ipv4_nameservers = ["1.1.1.1", "8.8.8.8"] - nic_ipv4 = "192.168.10.161" - nic_security = true - } } observability_instances = { @@ -277,24 +229,21 @@ observability_instances = { } ske_clusters = { - + /* "prod-cluster" = { name = "clusterprod" project_key = "projekt-alpha" - network_id = "53917a75-0014-49b0-a4d6-e62934ab479f" # WICHTIG: Hier die Netzwerk-ID connecten kubernetes_version_min = "1.32.5" node_pools = [ { - name = "defaulpool" + name = "np" machine_type = "c1.2" - availability_zones = ["eu01-1"] - minimum = 1 - maximum = 2 - cri = "containerd" + availability_zones = ["eu01-3", "eu01-1"] + minimum = 2 + maximum = 3 volume_type = "storage_premium_perf1" - volume_size = 21 - labels = { "worker" = "default" } + volume_size = 64 taints = [{ effect = "NoSchedule" key = "app" @@ -325,17 +274,16 @@ ske_clusters = { } } }, - + */ "dev-cluster" = { - name = "clusterdev" + name = "cluster" kubernetes_version_min = "1.32.5" - project_key = "projekt-beta" - network_id = "bedfc709-9285-4078-93ab-8e8a1c0be6bd" # WICHTIG: Hier die Netzwerk-ID connecten + project_key = "projekt-alpha" node_pools = [ { - name = "devpool" - machine_type = "c1.2" + name = "np" + machine_type = "g1.4" availability_zones = ["eu01-2"] minimum = 1 maximum = 2 @@ -343,4 +291,5 @@ ske_clusters = { } ] } + } diff --git a/example/variables.tf b/example/variables.tf index 65b7661..ee292d9 100644 --- a/example/variables.tf +++ b/example/variables.tf @@ -26,7 +26,7 @@ variable "organization_id" { variable "service_account_key_path" { type = string - default = "/users/schlenz/.stackit/sa.json" + default = "/home/hahnjan/.stackit/sa.json" } variable "default_region" { @@ -154,8 +154,6 @@ variable "ske_clusters" { name = string project_key = string - network_id = string - kubernetes_version_min = optional(string) hibernations = optional(list(object({ start = string diff --git a/ske/main.tf b/ske/main.tf index c96784f..2252538 100644 --- a/ske/main.tf +++ b/ske/main.tf @@ -2,7 +2,6 @@ resource "stackit_network" "ske_network" { project_id = var.project_id name = "ske_network" ipv4_nameservers = ["1.1.1.1", "9.9.9.9"] - ipv4_prefix_length = 24 } output "ske-egress-ip" { @@ -17,7 +16,9 @@ resource "stackit_ske_cluster" "this" { hibernations = var.hibernations maintenance = var.maintenance extensions = var.extensions - network = stackit_network.ske_network + network = { + id = stackit_network.ske_network.network_id + } region = var.default_region }