From 52e8c56682e8d7422ac524a1b3892186cc6c9db7 Mon Sep 17 00:00:00 2001 From: shockrah Date: Sun, 8 Dec 2024 14:06:32 -0800 Subject: [PATCH] Fixing constantly changing cluster fire wall group id --- infra/vultr-kubernetes/backend.tf | 8 ++++++++ infra/vultr-kubernetes/cluster.tf | 4 +++- infra/vultr-kubernetes/firewall.tf | 2 -- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/infra/vultr-kubernetes/backend.tf b/infra/vultr-kubernetes/backend.tf index cb55c07..5bdc517 100644 --- a/infra/vultr-kubernetes/backend.tf +++ b/infra/vultr-kubernetes/backend.tf @@ -15,6 +15,10 @@ terraform { source = "vultr/vultr" version = "2.22.1" } + kubernetes = { + source = "hashicorp/kubernetes" + version = "2.34.0" + } } } @@ -31,4 +35,8 @@ provider aws { max_retries = 1 } +provider kubernetes { + config_path = "config.yaml" +} + diff --git a/infra/vultr-kubernetes/cluster.tf b/infra/vultr-kubernetes/cluster.tf index 77f7f5c..185c986 100644 --- a/infra/vultr-kubernetes/cluster.tf +++ b/infra/vultr-kubernetes/cluster.tf @@ -2,7 +2,9 @@ resource vultr_kubernetes athens { region = var.cluster.region version = var.cluster.version label = var.cluster.label - enable_firewall = true + # BUG: only have this set when creating the resource for the first time + # once the cluster is up, we should comment this out again + # enable_firewall = true node_pools { # how many nodes do we want in this pool node_quantity = 1 diff --git a/infra/vultr-kubernetes/firewall.tf b/infra/vultr-kubernetes/firewall.tf index 2bf4b44..2a2973f 100644 --- a/infra/vultr-kubernetes/firewall.tf +++ b/infra/vultr-kubernetes/firewall.tf @@ -1,8 +1,6 @@ -# Inbound rules for web traffic resource vultr_firewall_rule web_inbound { for_each = toset([for port in [80, 443, 6443] : tostring(port) ]) firewall_group_id = vultr_kubernetes.athens.firewall_group_id - #firewall_group_id = vultr_firewall_group.cluster.id protocol = "tcp" ip_type = "v4" subnet = "0.0.0.0"