Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

[stable/external-dns] Add support for Dyn #12166

Closed
wants to merge 1 commit into from
Closed
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: 2 additions & 2 deletions stable/external-dns/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
name: external-dns
version: 2.0.2
appVersion: 0.5.15
version: 2.0.3
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please bump minor version instead

appVersion: 0.5.16
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to bump the appVersion. Indeed, we haven't release the version 0.5.16 yet, see https://hub.docker.com/r/bitnami/external-dns/tags/

description: ExternalDNS is a Kubernetes addon that configures public DNS servers with information about exposed Kubernetes services to make them discoverable.
keywords:
- external-dns
Expand Down
3 changes: 3 additions & 0 deletions stable/external-dns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ The following table lists the configurable parameters of the external-dns chart
| `designate.customCA.mountPath` | When using the Designate provider, set the mountPath in which to mount the custom CA configuration | "/config/designate" |
| `designate.customCA.filename` | When using the Designate provider, set the custom CA configuration filename | "designate-ca.pem" |
| `digitalocean.apiToken` | When using the DigitalOcean provider, `DO_TOKEN` to set (optional) | `""` |
| `dyn.customerName` | When using Dyn provider, specify the Dyn Customer Name. | `""` |
| `dyn.username` | When using Dyn provider, specify the Dyn Username. | `""` |
| `dyn.password` | When using Dyn provider, specify the Dyn Password. | `""`
| `google.project` | When using the Google provider, specify the Google project (required when provider=google) | `""` |
| `google.serviceAccountSecret` | When using the Google provider, specify the existing secret which contains credentials.json (optional) | `""` |
| `google.serviceAccountKey` | When using the Google provider, specify the service account key JSON file. (required when `google.serviceAccountSecret` is not provided. In this case a new secret will be created holding this service account | `""` |
Expand Down
22 changes: 22 additions & 0 deletions stable/external-dns/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,28 @@ spec:
name: {{ template "external-dns.fullname" . }}
key: digitalocean_api_token
{{- end }}
# Dyn environment variables
{{- if .Values.dyn.customerName }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an extra if statement:

{{- if eq .Values.provider "digitalocean" }}
...
{{- end }}

- name: EXTERNAL_DNS_DYN_CUSTOMER_NAME
valueFrom:
secretKeyRef:
name: {{ template "external-dns.fullname" . }}
key: dyn_customer_name
{{- end }}
{{- if .Values.dyn.username }}
- name: EXTERNAL_DNS_DYN_USERNAME
valueFrom:
secretKeyRef:
name: {{ template "external-dns.fullname" . }}
key: dyn_username
{{- end }}
{{- if .Values.dyn.password }}
- name: EXTERNAL_DNS_DYN_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "external-dns.fullname" . }}
key: dyn_password
{{- end }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: are any of these parameters mandatory when provider=dyn?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, all of these fields are required for provider=dyn

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

# Google environment variables
{{- if eq .Values.provider "google" }}
- name: GOOGLE_APPLICATION_CREDENTIALS
Expand Down
11 changes: 10 additions & 1 deletion stable/external-dns/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if or .Values.aws.assumeRoleArn (and .Values.aws.credentials.secretKey .Values.aws.credentials.accessKey) .Values.cloudflare.apiKey .Values.digitalocean.apiToken .Values.google.serviceAccountKey (and .Values.infoblox.wapiUsername .Values.infoblox.wapiPassword) .Values.rfc2136.tsigSecret .Values.extraEnv }}
{{- if or .Values.aws.assumeRoleArn (and .Values.aws.credentials.secretKey .Values.aws.credentials.accessKey) .Values.cloudflare.apiKey .Values.digitalocean.apiToken (and .Values.dyn.customerName .Values.dyn.username .Values.dyn.password) .Values.google.serviceAccountKey (and .Values.infoblox.wapiUsername .Values.infoblox.wapiPassword) .Values.rfc2136.tsigSecret .Values.extraEnv }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be and or or?

apiVersion: v1
kind: Secret
metadata:
Expand All @@ -23,6 +23,15 @@ data:
{{- if .Values.digitalocean.apiToken }}
digitalocean_api_token: {{ .Values.digitalocean.apiToken | b64enc | quote }}
{{- end }}
{{ if .Values.dyn.customerName }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add {{- to every if statement:

- {{ if .Values.dyn.customerName }}
+ {{- if .Values.dyn.customerName }}

dyn_customer_name: {{ .Values.dyn.customerName | b64enc | quote }}
{{- end }}
{{ if .Values.dyn.username }}
dyn_username: {{ .Values.dyn.username | b64enc | quote }}
{{- end }}
{{ if .Values.dyn.password }}
dyn_password: {{ .Values.dyn.password | b64enc | quote }}
{{- end }}
{{- if and .Values.infoblox.wapiUsername .Values.infoblox.wapiPassword }}
infoblox_wapi_username: {{ .Values.infoblox.wapiUsername | b64enc | quote }}
infoblox_wapi_password: {{ .Values.infoblox.wapiPassword | b64enc | quote }}
Expand Down
8 changes: 7 additions & 1 deletion stable/external-dns/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ sources:
# - crd

## DNS provider where the DNS records will be created. Available providers are:
## - aws, azure, cloudflare, designate, digitalocoean, google, infoblox, rfc2136
## - aws, azure, cloudflare, designate, digitalocoean, dyn, google, infoblox, rfc2136
##
provider: aws

Expand Down Expand Up @@ -120,6 +120,12 @@ digitalocean:
##
apiToken: ""

# Configuration for Dyn provider.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow the same format for comments:

- # Configuration for Dyn provider.
+ ## Configuration for Dyn provider.
+ ##

dyn:
customer_name: ""
username: ""
password: ""

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the values-production.yaml with the same changes too

## Google configuration to be set via arguments/env. variables
##
google:
Expand Down