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

Setting txtOwnerId for external-dns #20

Merged
merged 1 commit into from Sep 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions k8s/workloads/refractr/refractr-ingress.yaml
Expand Up @@ -35,6 +35,7 @@ spec:
service.beta.kubernetes.io/aws-load-balancer-type: "nlb"
service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: "true"
service.beta.kubernetes.io/aws-load-balancer-connection-draining-enabled: "true"
service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags: "Environment=stage"
# not really well documented except for this here:
# https://github.com/kubernetes/kubernetes/issues/63959
service.beta.kubernetes.io/aws-load-balancer-eip-allocations: "eipalloc-0448300623ab0783f,eipalloc-0787184616f563acb,eipalloc-05cc86db2fa7c78ed"
Expand Down
9 changes: 9 additions & 0 deletions terraform/external-dns.tf
Expand Up @@ -7,6 +7,7 @@ locals {
"policy" = "upsert-only"
"replicas" = "1"
"metrics.enabled" = "true"
"txtOwnerId" = "${module.itse-apps-stage-1.cluster_id}-${random_string.string.result}"
"serviceAccount.annotations.eks\\.amazonaws\\.com/role-arn" = module.external_dns_role.this_iam_role_arn
}

Expand Down Expand Up @@ -39,6 +40,14 @@ data "aws_iam_policy_document" "external_dns" {
}
}

resource "random_string" "string" {
length = 8
special = false
keepers = {
cluster_id = module.itse-apps-stage-1.cluster_id
}
}

resource "aws_iam_policy" "external_dns" {
name_prefix = "${local.external_dns_name_prefix}-policy-"
path = "/"
Expand Down