1
0
Fork 0

refactor: remove old node pool and cleanup dns records

This commit is contained in:
Vojtěch Mareš 2024-11-23 09:35:03 +01:00
parent b8b0a7ce22
commit 0523a8907b
Signed by: vojtech.mares
GPG key ID: C6827B976F17240D
3 changed files with 8 additions and 85 deletions

42
dns.tf
View file

@ -30,16 +30,6 @@ resource "cloudflare_record" "cthulhu_control_plane" {
proxied = false
}
resource "cloudflare_record" "cthulhu_control_plane_ipv6" {
count = length(hcloud_server.cthulhu_control_plane)
zone_id = data.cloudflare_zone.vxm_cz.id
name = "control-plane-${count.index}.cthulhu.k8s"
value = hcloud_server.cthulhu_control_plane[count.index].ipv6_address
type = "AAAA"
proxied = false
}
resource "cloudflare_record" "cthulhu_kubeapi_singlenode" {
count = length(hcloud_server.cthulhu_control_plane) == 1 ? 1 : 0
@ -50,40 +40,10 @@ resource "cloudflare_record" "cthulhu_kubeapi_singlenode" {
proxied = false
}
resource "cloudflare_record" "cthulhu_kubeapi_singlenode_ipv6" {
count = length(hcloud_server.cthulhu_control_plane) == 1 ? 1 : 0
zone_id = data.cloudflare_zone.vxm_cz.id
name = "api.cthulhu.k8s"
value = hcloud_server.cthulhu_control_plane[0].ipv6_address
type = "AAAA"
proxied = false
}
resource "cloudflare_record" "cthulhu_workers" {
count = length(hcloud_server.cthulhu_workers)
zone_id = data.cloudflare_zone.vxm_cz.id
name = "worker-${random_string.workers_suffix.result}-${count.index}.cthulhu.k8s"
value = hcloud_server.cthulhu_workers[count.index].ipv4_address
type = "A"
proxied = false
}
resource "cloudflare_record" "cthulhu_workers_ipv6" {
count = length(hcloud_server.cthulhu_workers)
zone_id = data.cloudflare_zone.vxm_cz.id
name = "worker-${random_string.workers_suffix.result}-${count.index}.cthulhu.k8s"
value = hcloud_server.cthulhu_workers[count.index].ipv6_address
type = "AAAA"
proxied = false
}
resource "cloudflare_record" "cthulhu_wildcard" {
zone_id = data.cloudflare_zone.vxm_cz.id
name = "*.cthulhu.k8s"
value = cloudflare_record.ingress_cthulhu_k8s_vxm_cz.hostname
type = "CNAME"
proxied = false
}
}