diff --git a/k8s/applications/templates/external-dns.yaml b/k8s/applications/templates/external-dns.yaml index ba2f451..8789ad1 100644 --- a/k8s/applications/templates/external-dns.yaml +++ b/k8s/applications/templates/external-dns.yaml @@ -8,7 +8,7 @@ spec: namespace: external-dns server: 'https://kubernetes.default.svc' source: - path: k8s/external-dns + path: k8s/external-dns/overlays/{{ .Values.environment }} repoURL: 'git@bitbucket.org:jamkazam/video-iac.git' targetRevision: HEAD project: default diff --git a/k8s/external-dns/base/kustomization.yaml b/k8s/external-dns/base/kustomization.yaml new file mode 100644 index 0000000..d7b5524 --- /dev/null +++ b/k8s/external-dns/base/kustomization.yaml @@ -0,0 +1,7 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: external-dns + +resources: + - https://github.com/kubernetes-sigs/external-dns/kustomize?ref=v0.8.0 \ No newline at end of file diff --git a/k8s/external-dns/overlays/production/configuration.yaml b/k8s/external-dns/overlays/production/configuration.yaml new file mode 100644 index 0000000..c89467e --- /dev/null +++ b/k8s/external-dns/overlays/production/configuration.yaml @@ -0,0 +1,28 @@ +--- +- op: replace + path: /spec/template/spec/containers/0/args + value: + - --aws-api-retries=3 + - --domain-filter=video.jamkazam.com + - --interval=1m + - --log-format=text + - --log-level=warning + - --no-aws-evaluate-target-health + - --policy=sync + - --provider=aws + - --registry=txt + - --source=ingress + - --txt-prefix=production_ # Random string for hardener TXT entries +- op: replace + path: /spec/template/spec/containers/0/env + value: + - name: AWS_ACCESS_KEY_ID + valueFrom: + secretKeyRef: + name: aws-user-external-dns + key: username + - name: AWS_SECRET_ACCESS_KEY + valueFrom: + secretKeyRef: + name: aws-user-external-dns + key: password \ No newline at end of file diff --git a/k8s/external-dns/overlays/production/kustomization.yaml b/k8s/external-dns/overlays/production/kustomization.yaml new file mode 100644 index 0000000..6e9be3e --- /dev/null +++ b/k8s/external-dns/overlays/production/kustomization.yaml @@ -0,0 +1,14 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +bases: +- ../../base + +patchesJson6902: + - path: configuration.yaml + target: + group: apps + version: v1 + kind: Deployment + name: external-dns \ No newline at end of file diff --git a/k8s/external-dns/overlays/configuration.yaml b/k8s/external-dns/overlays/staging/configuration.yaml similarity index 87% rename from k8s/external-dns/overlays/configuration.yaml rename to k8s/external-dns/overlays/staging/configuration.yaml index 51936cd..3ac753d 100644 --- a/k8s/external-dns/overlays/configuration.yaml +++ b/k8s/external-dns/overlays/staging/configuration.yaml @@ -12,7 +12,7 @@ - --provider=aws - --registry=txt - --source=ingress - - --txt-prefix=fmifrruf_ # Random string for hardener TXT entries + - --txt-prefix=staging_ # Random string for hardener TXT entries - op: replace path: /spec/template/spec/containers/0/env value: diff --git a/k8s/external-dns/kustomization.yaml b/k8s/external-dns/overlays/staging/kustomization.yaml similarity index 81% rename from k8s/external-dns/kustomization.yaml rename to k8s/external-dns/overlays/staging/kustomization.yaml index 4ad4cb6..5c473e5 100644 --- a/k8s/external-dns/kustomization.yaml +++ b/k8s/external-dns/overlays/staging/kustomization.yaml @@ -7,7 +7,7 @@ resources: - https://github.com/kubernetes-sigs/external-dns/kustomize?ref=v0.8.0 patchesJson6902: - - path: overlays/configuration.yaml + - path: configuration.yaml target: group: apps version: v1