Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding k8s-external-dns-azure multiple DNS zone support #204

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion k8s-external-dns-azure/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ resource "azurerm_role_assignment" "external_dns" {
}

resource "kubernetes_secret" "external_dns" {
for_each = { for zone in var.azure_dns_zones.dns_zones : zone => zone }

metadata {
name = "external-dns-auth"
name = "external-dns-auth-${each.value}"
namespace = var.namespace
labels = var.md_metadata.default_tags
}
Expand Down
5 changes: 3 additions & 2 deletions k8s-external-dns-azure/main.tf
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
module "external-dns" {
for_each = { for zone in var.azure_dns_zones.dns_zones : zone => zone }
source = "../k8s-external-dns"
md_metadata = var.md_metadata
kubernetes_cluster = var.kubernetes_cluster
release = var.release
release = regex("^[a-z0-9-]+", "${var.release}-${each.value}")
namespace = var.namespace
domain_filters = local.domain_filters
helm_additional_values = {
extraVolumes = [{
name = "azure-config-file"
secret = {
secretName = kubernetes_secret.external_dns.metadata[0].name
secretName = kubernetes_secret.external_dns[each.key].metadata[0].name
items = [{
key = "azure.json"
path = "azure.json"
Expand Down