Fixing constantly changing cluster fire wall group id
Some checks failed
Ansible Linting / ansible-lint (push) Failing after 3s
Secops Linting and Safety Checks / checkov-scan-s3 (push) Failing after 13s

This commit is contained in:
shockrah 2024-12-08 14:06:32 -08:00
parent c50deddf53
commit 52e8c56682
3 changed files with 11 additions and 3 deletions

View File

@ -15,6 +15,10 @@ terraform {
source = "vultr/vultr" source = "vultr/vultr"
version = "2.22.1" version = "2.22.1"
} }
kubernetes = {
source = "hashicorp/kubernetes"
version = "2.34.0"
}
} }
} }
@ -31,4 +35,8 @@ provider aws {
max_retries = 1 max_retries = 1
} }
provider kubernetes {
config_path = "config.yaml"
}

View File

@ -2,7 +2,9 @@ resource vultr_kubernetes athens {
region = var.cluster.region region = var.cluster.region
version = var.cluster.version version = var.cluster.version
label = var.cluster.label 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 { node_pools {
# how many nodes do we want in this pool # how many nodes do we want in this pool
node_quantity = 1 node_quantity = 1

View File

@ -1,8 +1,6 @@
# Inbound rules for web traffic
resource vultr_firewall_rule web_inbound { resource vultr_firewall_rule web_inbound {
for_each = toset([for port in [80, 443, 6443] : tostring(port) ]) for_each = toset([for port in [80, 443, 6443] : tostring(port) ])
firewall_group_id = vultr_kubernetes.athens.firewall_group_id firewall_group_id = vultr_kubernetes.athens.firewall_group_id
#firewall_group_id = vultr_firewall_group.cluster.id
protocol = "tcp" protocol = "tcp"
ip_type = "v4" ip_type = "v4"
subnet = "0.0.0.0" subnet = "0.0.0.0"