helm-charts/external-dns/templates/secret.yaml

95 lines
4.2 KiB
YAML

{{- if (include "external-dns.createSecret" .) }}
apiVersion: v1
kind: Secret
metadata:
name: {{ template "external-dns.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels: {{ include "external-dns.labels" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.secretAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.secretAnnotations "context" $ ) | nindent 4 }}
{{- end }}
type: Opaque
data:
{{- if eq .Values.provider "alibabacloud" }}
alibaba-cloud.json: {{ include "external-dns.alibabacloud-credentials" . | b64enc | quote }}
{{- end }}
{{- if eq .Values.provider "aws" }}
credentials: {{ include "external-dns.aws-credentials" . | b64enc | quote }}
{{- if .Values.aws.region }}
config: {{ include "external-dns.aws-config" . | b64enc | quote }}
{{- end }}
{{- end }}
{{- if or (eq .Values.provider "azure") (eq .Values.provider "azure-private-dns") }}
azure.json: {{ include "external-dns.azure-credentials" . | b64enc | quote }}
{{- end }}
{{- if eq .Values.provider "google" }}
credentials.json: {{ .Values.google.serviceAccountKey | b64enc | quote }}
{{- end }}
{{- if and (eq .Values.provider "hetzner") (not .Values.hetzner.secretName) }}
hetzner_token: {{ .Values.hetzner.token | b64enc | quote }}
{{- end }}
{{- if eq .Values.provider "cloudflare" }}
{{- if .Values.cloudflare.apiToken }}
cloudflare_api_token: {{ .Values.cloudflare.apiToken | b64enc | quote }}
{{- else }}
cloudflare_api_key: {{ required "cloudflare.apiKey is required if cloudflare.apiToken is not provided" .Values.cloudflare.apiKey | b64enc | quote }}
{{- end }}
{{- end }}
{{- if eq .Values.provider "designate" }}
{{- if .Values.designate.username }}
designate_username: {{ .Values.designate.username | b64enc | quote }}
{{- end }}
{{- if .Values.designate.password }}
designate_password: {{ .Values.designate.password | b64enc | quote }}
{{- end }}
{{- end }}
{{- if eq .Values.provider "digitalocean" }}
digitalocean_api_token: {{ .Values.digitalocean.apiToken | b64enc | quote }}
{{- end }}
{{- if eq .Values.provider "infoblox" }}
infoblox_wapi_username: {{ .Values.infoblox.wapiUsername | b64enc | quote }}
infoblox_wapi_password: {{ .Values.infoblox.wapiPassword | b64enc | quote }}
{{- end }}
{{- if eq .Values.provider "linode" }}
linode_api_token: {{ .Values.linode.apiToken | b64enc | quote }}
{{- end }}
{{- if eq .Values.provider "oci" }}
oci.yaml: {{ include "external-dns.oci-credentials" . | b64enc | quote }}
{{- end }}
{{- if eq .Values.provider "pdns" }}
pdns_api_key: {{ .Values.pdns.apiKey | b64enc | quote }}
{{- end }}
{{- if eq .Values.provider "rfc2136" }}
rfc2136_tsig_secret: {{ .Values.rfc2136.tsigSecret | b64enc | quote }}
rfc2136_kerberos_username: {{ .Values.rfc2136.kerberosUsername | b64enc | quote }}
rfc2136_kerberos_password: {{ .Values.rfc2136.kerberosPassword | b64enc | quote }}
{{- end }}
{{- if eq .Values.provider "transip" }}
transip-api-key: {{ .Values.transip.apiKey | b64enc | quote }}
{{- end }}
{{- if eq .Values.provider "ovh" }}
ovh_consumer_key: {{ .Values.ovh.consumerKey | b64enc | quote }}
ovh_application_key: {{ .Values.ovh.applicationKey | b64enc | quote }}
ovh_application_secret: {{ .Values.ovh.applicationSecret | b64enc | quote }}
{{- end }}
{{- if eq .Values.provider "scaleway" }}
scw_access_key: {{ .Values.scaleway.scwAccessKey | b64enc | quote }}
scw_secret_key: {{ .Values.scaleway.scwSecretKey | b64enc | quote }}
scw_default_organization_id: {{ .Values.scaleway.scwDefaultOrganizationId | b64enc | quote }}
{{- end }}
{{- if eq .Values.provider "vinyldns" }}
vinyldns-access-key: {{ .Values.vinyldns.accessKey | b64enc | quote }}
vinyldns-secret-key: {{ .Values.vinyldns.secretKey | b64enc | quote }}
{{- end }}
{{- if eq .Values.provider "ns1" }}
ns1-api-key: {{ .Values.ns1.apiKey | b64enc | quote }}
{{- end }}
{{- end }}