1
0
Fork 0
This repository has been archived on 2025-08-23. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
mareshq-cthulhunetes-infras.../dns.tf

89 lines
No EOL
2.7 KiB
HCL

# data "cloudflare_zone" "cthulhunetes" {
# name = "cthulhunetes.net"
# }
# resource "cloudflare_zone" "cthulhunetes" {
# account_id = "f24333bb3c47d6db753e57e2a0c90082"
# zone = "cthulhunetes.net"
# }
# resource "cloudflare_zone_dnssec" "cthulhunetes" {
# zone_id = cloudflare_zone.cthulhunetes.id
# }
# resource "cloudflare_zone_settings_override" "cthulhunetes" {
# zone_id = cloudflare_zone.cthulhunetes.id
# settings {
# always_use_https = "on"
# automatic_https_rewrites = "on"
# ssl = "full"
# }
# }
resource "cloudflare_record" "cthulhu_control_plane" {
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].ipv4_address
type = "A"
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
zone_id = data.cloudflare_zone.vxm_cz.id
name = "api.cthulhu.k8s"
value = hcloud_server.cthulhu_control_plane[0].ipv4_address
type = "A"
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
}