Compare commits

..

3 Commits

Author SHA1 Message Date
Ariadne Conill 9882b0a2da dns: decommission kn-linode-dallas ingress
ci/woodpecker/push/dns Pipeline was successful Details
2022-07-30 06:13:03 +00:00
Ariadne Conill 3fa93e7d00 dns: social: switch ingress to kn-sfo2
ci/woodpecker/push/dns Pipeline was successful Details
2022-07-30 05:49:05 +00:00
Ariadne Conill 438ec1367e main: add kn-sfo2 ingress
ci/woodpecker/push/dns Pipeline was successful Details
2022-07-30 04:20:01 +00:00
1 changed files with 106 additions and 90 deletions

View File

@ -1,8 +1,8 @@
terraform { terraform {
required_providers { required_providers {
dns = { linode = {
source = "hashicorp/dns" source = "linode/linode"
version = "3.2.3" version = "1.26.0"
} }
} }
@ -16,144 +16,160 @@ terraform {
} }
} }
provider "dns" { provider "linode" {
update { token = var.token
server = "ns1.as207960.net"
key_name = "treehouse.systems."
key_algorithm = "hmac-sha512"
key_secret = var.secret
}
} }
// Treehouse cluster: kn-linode-dallas resource "linode_domain" "treehouse_domain" {
// TODO(ariadne): Use linode data source to pull the kubernetes ingress domain = "treehouse.systems"
// IP addresses for this soa_email = "admin@treehouse.systems"
resource "dns_a_record_set" "kn_linode_dallas_ingress_v4" { type = "master"
zone = "treehouse.systems."
name = "kn-linode-dallas.ingress"
addresses = ["50.116.20.32"]
ttl = 3600
}
resource "dns_aaaa_record_set" "kn_linode_dallas_ingress_v6" {
zone = "treehouse.systems."
name = "kn-linode-dallas.ingress"
addresses = ["2600:3c00::f03c:93ff:fee2:d097"]
ttl = 3600
} }
// Treehouse cluster: kn-oci-sanjose // Treehouse cluster: kn-oci-sanjose
// TODO(ariadne): decommission me // TODO(ariadne): decommission me
resource "dns_a_record_set" "kn_oci_sanjose_ingress_v4" { resource "linode_domain_record" "kn_oci_sanjose_ingress_v4" {
zone = "treehouse.systems." domain_id = "${linode_domain.treehouse_domain.id}"
name = "kn-oci-sanjose.ingress" name = "kn-oci-sanjose.ingress"
addresses = ["152.67.234.163"] record_type = "A"
ttl = 3600 target = "152.67.234.163"
ttl_sec = 30
} }
resource "dns_aaaa_record_set" "kn_oci_sanjose_ingress_v6" { resource "linode_domain_record" "kn_oci_sanjose_ingress_v6" {
zone = "treehouse.systems." domain_id = "${linode_domain.treehouse_domain.id}"
name = "kn-oci-sanjose.ingress" name = "kn-oci-sanjose.ingress"
addresses = ["2603:c024:c000:100::80"] record_type = "AAAA"
ttl = 3600 target = "2603:c024:c000:100::80"
ttl_sec = 30
}
// Treehouse cluster: kn-sfo2
resource "linode_domain_record" "kn_sfo2_ingress_v4" {
domain_id = "${linode_domain.treehouse_domain.id}"
name = "kn-sfo2.ingress"
record_type = "A"
target = "104.250.236.4"
ttl_sec = 30
}
resource "linode_domain_record" "kn_sfo2_ingress_v6" {
domain_id = "${linode_domain.treehouse_domain.id}"
name = "kn-sfo2.ingress"
record_type = "AAAA"
target = "2602:fd37:1:0:104:250:236:4"
ttl_sec = 30
} }
// Treehouse services: Gitea // Treehouse services: Gitea
resource "dns_a_record_set" "gitea_v4" { resource "linode_domain_record" "gitea_v4" {
zone = "treehouse.systems." domain_id = "${linode_domain.treehouse_domain.id}"
name = "gitea" name = "gitea"
addresses = ["104.250.236.2"] record_type = "A"
ttl = 3600 target = "104.250.236.2"
ttl_sec = 30
} }
resource "dns_aaaa_record_set" "gitea_v6" { resource "linode_domain_record" "gitea_v6" {
zone = "treehouse.systems." domain_id = "${linode_domain.treehouse_domain.id}"
name = "gitea" name = "gitea"
addresses = ["2602:fd37:1:0:104:250:236:2"] record_type = "AAAA"
ttl = 3600 target = "2602:fd37:1:0:104:250:236:2"
ttl_sec = 30
} }
resource "dns_cname_record" "woodpecker_cname" { resource "linode_domain_record" "woodpecker_cname" {
zone = "treehouse.systems." domain_id = "${linode_domain.treehouse_domain.id}"
name = "woodpecker" name = "woodpecker"
cname = "gitea.treehouse.systems." record_type = "CNAME"
ttl = 3600 target = "gitea.treehouse.systems"
ttl_sec = 30
} }
// Treehouse services: Mastodon (running on kn-linode-dallas) // Treehouse services: Mastodon (running on kn-linode-dallas)
resource "dns_cname_record" "social_cname" { resource "linode_domain_record" "social_cname" {
zone = "treehouse.systems." domain_id = "${linode_domain.treehouse_domain.id}"
name = "social" name = "social"
cname = "kn-linode-dallas.ingress.treehouse.systems." record_type = "CNAME"
ttl = 3600 target = "kn-sfo2.ingress.treehouse.systems"
ttl_sec = 30
} }
resource "dns_cname_record" "cache_cname" { resource "linode_domain_record" "cache_cname" {
zone = "treehouse.systems." domain_id = "${linode_domain.treehouse_domain.id}"
name = "cache" name = "cache"
cname = "treehousesystems.b-cdn.net." record_type = "CNAME"
ttl = 3600 target = "treehousesystems.b-cdn.net"
ttl_sec = 30
} }
// Treehouse services: Discord redirector. // Treehouse services: Discord redirector.
// TODO(ariadne): This is really now treehouse.systems/discord, but // TODO(ariadne): This is really now treehouse.systems/discord, but
// we need to keep this one for a while until it can be fully // we need to keep this one for a while until it can be fully
// decommissioned. // decommissioned.
resource "dns_cname_record" "discord_cname" { resource "linode_domain_record" "discord_cname" {
zone = "treehouse.systems." domain_id = "${linode_domain.treehouse_domain.id}"
name = "discord" name = "discord"
cname = "kn-oci-sanjose.ingress.treehouse.systems." record_type = "CNAME"
ttl = 3600 target = "kn-oci-sanjose.ingress.treehouse.systems"
ttl_sec = 30
} }
// Treehouse services: Minecraft (OVH, managed by Kenneth) // Treehouse services: Minecraft (OVH, managed by Kenneth)
resource "dns_cname_record" "minecraft_cname" { resource "linode_domain_record" "minecraft_cname" {
zone = "treehouse.systems." domain_id = "${linode_domain.treehouse_domain.id}"
name = "survival.minecraft" name = "survival.minecraft"
cname = "survival.treehouse.fork.run." record_type = "CNAME"
ttl = 3600 target = "survival.treehouse.fork.run"
ttl_sec = 30
} }
// Apex domain settings. // Apex domain settings.
resource "dns_a_record_set" "apex_v4" { resource "linode_domain_record" "apex_v4" {
zone = "treehouse.systems." domain_id = "${linode_domain.treehouse_domain.id}"
addresses = ["152.67.234.163"] name = ""
ttl = 3600 record_type = "A"
target = "152.67.234.163"
ttl_sec = 30
} }
resource "dns_aaaa_record_set" "apex_v6" { resource "linode_domain_record" "apex_v6" {
zone = "treehouse.systems." domain_id = "${linode_domain.treehouse_domain.id}"
addresses = ["2603:c024:c000:100::80"] name = ""
ttl = 3600 record_type = "AAAA"
target = "2603:c024:c000:100::80"
ttl_sec = 30
} }
resource "dns_mx_record_set" "apex_mx" { resource "linode_domain_record" "apex_mx" {
zone = "treehouse.systems." domain_id = "${linode_domain.treehouse_domain.id}"
name = ""
mx { record_type = "MX"
preference = 5 target = "mx1.mailbun.net"
exchange = "mx1.mailbun.net." priority = "5"
} ttl_sec = 30
ttl = 3600
} }
resource "dns_txt_record_set" "apex_spf" { resource "linode_domain_record" "apex_spf" {
zone = "treehouse.systems." domain_id = "${linode_domain.treehouse_domain.id}"
txt = ["v=spf1 a mx include:spf.mailbun.net ~all"] name = ""
ttl = 3600 record_type = "TXT"
target = "v=spf1 a mx include:spf.mailbun.net ~all"
ttl_sec = 30
} }
resource "dns_txt_record_set" "apex_dmarc" { resource "linode_domain_record" "apex_dmarc" {
zone = "treehouse.systems." domain_id = "${linode_domain.treehouse_domain.id}"
name = "_dmarc" name = "_dmarc"
txt = ["v=DMARC1; p=none; fo=1; rua=mailto:admin@treehouse.systems"] record_type = "TXT"
ttl = 3600 target = "v=DMARC1; p=none; fo=1; rua=mailto:admin@treehouse.systems"
ttl_sec = 30
} }
resource "dns_txt_record_set" "apex_domainkey" { resource "linode_domain_record" "apex_domainkey" {
zone = "treehouse.systems." domain_id = "${linode_domain.treehouse_domain.id}"
name = "mailbun._domainkey" name = "mailbun._domainkey"
txt = ["v=DKIM1; k=rsa; s=email; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlJGZN1aCAUd8CqyQA7Akzkvns+Wq/w70ft2xr0B8jFp0DtW8BtyLLAsErpIp5ZTDgReYGgL7cNcSsNQRn+d6ZaOBGlC/gH1T3KYfbsvavOdnbGx9gofi6x8I5QOOLhp7epK5YkaP/Igg58Zm0ni3jdeMCuX+qkJVqn2WVv8IcRtIA3zJrTYOW3lGCj1ieezl5ref+43mFvcUqidToR9XyHNmi1RowmWAofbZASXkNqZiR1P2Jw3s7q6p0fAEz6bODNOmngIlRAaKjBfDVezsaTeQJwsMg9g58GigVTSb9gMHRZon61yxWcCJtcivPug7xAVlVU+MMkDr7MfvUke5KQIDAQAB"] record_type = "TXT"
ttl = 3600 target = "v=DKIM1; k=rsa; s=email; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlJGZN1aCAUd8CqyQA7Akzkvns+Wq/w70ft2xr0B8jFp0DtW8BtyLLAsErpIp5ZTDgReYGgL7cNcSsNQRn+d6ZaOBGlC/gH1T3KYfbsvavOdnbGx9gofi6x8I5QOOLhp7epK5YkaP/Igg58Zm0ni3jdeMCuX+qkJVqn2WVv8IcRtIA3zJrTYOW3lGCj1ieezl5ref+43mFvcUqidToR9XyHNmi1RowmWAofbZASXkNqZiR1P2Jw3s7q6p0fAEz6bODNOmngIlRAaKjBfDVezsaTeQJwsMg9g58GigVTSb9gMHRZon61yxWcCJtcivPug7xAVlVU+MMkDr7MfvUke5KQIDAQAB"
ttl_sec = 30
} }