@@ -114,7 +114,9 @@ imagePullSecrets:
114114Return true if a secret object should be created
115115*/} }
116116{ {- define " external-dns.createSecret" -} }
117- { {- if and (eq .Values.provider " aws" ) .Values.aws.credentials.secretKey .Values.aws.credentials.accessKey (not .Values.aws.credentials.secretName) } }
117+ { {- if and (eq .Values.provider " alibabacloud" ) .Values.alibabacloud.accessKeyId .Values.alibabacloud.accessKeySecret (not .Values.alibabacloud.secretName) } }
118+ { {- true -} }
119+ { {- else if and (eq .Values.provider " aws" ) .Values.aws.credentials.secretKey .Values.aws.credentials.accessKey (not .Values.aws.credentials.secretName) } }
118120 { {- true -} }
119121{ {- else if and (eq .Values.provider " azure" ) (or (and .Values.azure.resourceGroup .Values.azure.tenantId .Values.azure.subscriptionId .Values.azure.aadClientId .Values.azure.aadClientSecret (not .Values.azure.useManagedIdentityExtension)) (and .Values.azure.resourceGroup .Values.azure.tenantId .Values.azure.subscriptionId .Values.azure.useManagedIdentityExtension)) (not .Values.azure.secretName) -} }
120122 { {- true -} }
@@ -132,12 +134,14 @@ Return true if a secret object should be created
132134 { {- true -} }
133135{ {- else if and (eq .Values.provider " rfc2136" ) .Values.rfc2136.tsigSecret -} }
134136 { {- true -} }
135- { {- else if and (eq .Values.provider " pdns" ) .Values.pdns.apiKey -} }
137+ { {- else if and (eq .Values.provider " pdns" ) .Values.pdns.apiKey ( not .Values.pdns.secretName) -} }
136138 { {- true -} }
137139{ {- else if and (eq .Values.provider " transip" ) .Values.transip.apiKey -} }
138140 { {- true -} }
139141{ {- else if and (eq .Values.provider " ovh" ) .Values.ovh.consumerKey -} }
140142 { {- true -} }
143+ { {- else if and (eq .Values.provider " vinyldns" ) (or .Values.vinyldns.secretKey .Values.vinyldns.accessKey) -} }
144+ { {- true -} }
141145{ {- else -} }
142146{ {- end -} }
143147{ {- end -} }
@@ -146,7 +150,9 @@ Return true if a secret object should be created
146150Return the name of the Secret used to store the passwords
147151*/} }
148152{ {- define " external-dns.secretName" -} }
149- { {- if and (eq .Values.provider " aws" ) .Values.aws.credentials.secretName } }
153+ { {- if and (eq .Values.provider " alibabacloud" ) .Values.alibabacloud.secretName } }
154+ { {- .Values.alibabacloud.secretName } }
155+ { {- else if and (eq .Values.provider " aws" ) .Values.aws.credentials.secretName } }
150156{ {- .Values.aws.credentials.secretName } }
151157{ {- else if and (or (eq .Values.provider " azure" ) (eq .Values.provider " azure-private-dns" )) .Values.azure.secretName } }
152158{ {- .Values.azure.secretName } }
@@ -156,11 +162,27 @@ Return the name of the Secret used to store the passwords
156162{ {- .Values.digitalocean.secretName } }
157163{ {- else if and (eq .Values.provider " google" ) .Values.google.serviceAccountSecret } }
158164{ {- .Values.google.serviceAccountSecret } }
165+ { {- else if and (eq .Values.provider " pdns" ) .Values.pdns.secretName } }
166+ { {- .Values.pdns.secretName } }
159167{ {- else -} }
160168{ {- template " external-dns.fullname" . } }
161169{ {- end -} }
162170{ {- end -} }
163171
172+ { {- define " external-dns.alibabacloud-credentials" -} }
173+ {
174+ {{- if .Values.alibabacloud.regionId } }
175+ "regionId": "{ { .Values.alibabacloud.regionId } }",
176+ { {- end} }
177+ { {- if .Values.alibabacloud.accessKeyId } }
178+ "accessKeyId": "{ { .Values.alibabacloud.accessKeyId } }",
179+ { {- end} }
180+ { {- if .Values.alibabacloud.accessKeySecret } }
181+ "accessKeySecret": "{ { .Values.alibabacloud.accessKeySecret } }"
182+ { {- end} }
183+ }
184+ { { end } }
185+
164186{ {- define " external-dns.aws-credentials" } }
165187[default]
166188aws_access_key_id = { { .Values.aws.credentials.accessKey } }
@@ -214,7 +236,8 @@ Compile all warnings into a single message, and call fail.
214236{ {- $messages := append $messages (include " external-dns.validateValues.azurePrivateDns.subscriptionId" .) -} }
215237{ {- $messages := append $messages (include " external-dns.validateValues.azurePrivateDns.aadClientId" .) -} }
216238{ {- $messages := append $messages (include " external-dns.validateValues.azurePrivateDns.aadClientSecret" .) -} }
217- { {- $messages := append $messages (include " external-dns.validateValues.azurePrivateDns.useManagedIdentityExtensionNotSupported" .) -} }
239+ { {- $messages := append $messages (include " external-dns.validateValues.azurePrivateDns.useManagedIdentityExtensionAadClientId" .) -} }
240+ { {- $messages := append $messages (include " external-dns.validateValues.azurePrivateDns.useManagedIdentityExtensionAadClientSecret" .) -} }
218241{ {- $messages := append $messages (include " external-dns.validateValues.transip.account" .) -} }
219242{ {- $messages := append $messages (include " external-dns.validateValues.transip.apiKey" .) -} }
220243{ {- $messages := append $messages (include " external-dns.validateValues.ovh.consumerKey" .) -} }
@@ -319,7 +342,7 @@ Validate values of External DNS:
319342- must provide the PowerDNS API key when provider is " pdns"
320343*/} }
321344{ {- define " external-dns.validateValues.pdns.apiKey" -} }
322- { {- if and (eq .Values.provider " pdns" ) (not .Values.pdns.apiKey) -} }
345+ { {- if and (eq .Values.provider " pdns" ) (not .Values.pdns.apiKey) ( not .Values.pdns.secretName) -} }
323346external-dns: pdns.apiKey
324347 You must provide the the PowerDNS API key when provider="pdns".
325348 Please set the apiKey parameter (--set pdns.apiKey="xxxx")
@@ -418,6 +441,18 @@ external-dns: azure.useManagedIdentityExtension
418441{ {- end -} }
419442{ {- end -} }
420443
444+ { {/*
445+ Validate values of Azure Private DNS:
446+ - must provide the Azure AAD Client Secret when provider is " azure-private-dns" , secretName is not set and useManagedIdentityExtension is " true"
447+ */} }
448+ { {- define " external-dns.validateValues.azurePrivateDns.useManagedIdentityExtensionAadClientSecret" -} }
449+ { {- if and (eq .Values.provider " azure-private-dns" ) (not .Values.azure.secretName) .Values.azure.aadClientSecret .Values.azure.useManagedIdentityExtension -} }
450+ external-dns: azure.useManagedIdentityExtension
451+ You must not provide the Azure AAD Client Secret when provider="azure-private-dns", secretName is not set, and useManagedIdentityExtension is "true".
452+ Please unset the aadClientSecret parameter (--set azure.aadClientSecret="")
453+ { {- end -} }
454+ { {- end -} }
455+
421456{ {/*
422457Validate values of Azure Private DNS:
423458- must provide the Azure Resource Group when provider is " azure-private-dns"
@@ -457,41 +492,40 @@ external-dns: azure.subscriptionId
457492
458493{ {/*
459494Validate values of Azure Private DNS:
460- - must provide the Azure AAD Client ID when provider is " azure-private-dns" and secretName is not set
495+ - must not provide the Azure AAD Client Secret when provider is " azure-private-dns" , secretName is not set and MSI is enabled
461496*/} }
462- { {- define " external-dns.validateValues.azurePrivateDns.aadClientId " -} }
463- { {- if and (eq .Values.provider " azure-private-dns" ) (not .Values.azure.secretName) ( not .Values.azure.aadClientId) -} }
464- external-dns: azure.aadClientId
465- You must provide the Azure AAD Client ID when provider="azure-private-dns".
466- Please set the aadClientId parameter (--set azure.aadClientId="xxxx ")
497+ { {- define " external-dns.validateValues.azurePrivateDns.useManagedIdentityExtensionAadClientId " -} }
498+ { {- if and (eq .Values.provider " azure-private-dns" ) (not .Values.azure.secretName) .Values.azure.aadClientId .Values.azure.useManagedIdentityExtension -} }
499+ external-dns: azure.useManagedIdentityExtension
500+ You must not provide the Azure AAD Client ID when provider="azure-private-dns" and useManagedIdentityExtension is "true ".
501+ Please unset the aadClientId parameter (--set azure.aadClientId="")
467502{ {- end -} }
468503{ {- end -} }
469504
470505{ {/*
471506Validate values of Azure Private DNS:
472- - must provide the Azure AAD Client Secret when provider is " azure-private-dns" and secretName is not set
507+ - must provide the Azure AAD Client ID when provider is " azure-private-dns" , secret name is not set and MSI is disabled
473508*/} }
474- { {- define " external-dns.validateValues.azurePrivateDns.aadClientSecret " -} }
475- { {- if and (eq .Values.provider " azure-private-dns" ) (not .Values.azure.secretName) (not .Values.azure.aadClientSecret ) -} }
476- external-dns: azure.aadClientSecret
477- You must provide the Azure AAD Client Secret when provider="azure-private-dns".
478- Please set the aadClientSecret parameter (--set azure.aadClientSecret ="xxxx")
509+ { {- define " external-dns.validateValues.azurePrivateDns.aadClientId " -} }
510+ { {- if and (eq .Values.provider " azure-private-dns" ) (not .Values.azure.secretName) (not .Values.azure.aadClientId) ( not .Values.azure.useManagedIdentityExtension ) -} }
511+ external-dns: azure.useManagedIdentityExtension
512+ You must provide the Azure AAD Client ID when provider="azure-private-dns" and useManagedIdentityExtension is not set .
513+ Please set the aadClientSecret parameter (--set azure.aadClientId ="xxxx")
479514{ {- end -} }
480515{ {- end -} }
481516
482517{ {/*
483518Validate values of Azure Private DNS:
484- - MSI is not currently supported by external-dns for azure-private-dns, see https://github.com/kubernetes-sigs/external-dns/issues/1510
519+ - must provide the Azure AAD Client Secret when provider is " azure-private-dns" , secretName is not set and MSI is disabled
485520*/} }
486- { {- define " external-dns.validateValues.azurePrivateDns.useManagedIdentityExtensionNotSupported " -} }
487- { {- if and (eq .Values.provider " azure-private-dns" ) (.Values.azure.useManagedIdentityExtension) -} }
521+ { {- define " external-dns.validateValues.azurePrivateDns.aadClientSecret " -} }
522+ { {- if and (eq .Values.provider " azure-private-dns" ) (not .Values.azure.secretName) ( not .Values.azure.aadClientSecret) ( not .Values.azure.useManagedIdentityExtension) -} }
488523external-dns: azure.useManagedIdentityExtension
489- The value useManagedIdentityExtension is not supported in provider "azure-private-dns"
490- Please set the aadClientId & aadClientSecret values and unset useManagedIdentityExtension (--set azure.useManagedIdentityExtension=false,azure.aadClientID="xxxx", azure.aadClientSecret="xxxx")
524+ You must provide the Azure AAD Client Secret when provider= "azure-private-dns" and useManagedIdentityExtension is not set.
525+ Please set the aadClientSecret parameter (--set azure.aadClientSecret="xxxx")
491526{ {- end -} }
492527{ {- end -} }
493528
494-
495529{ {/*
496530Validate values of TransIP DNS:
497531- must provide the account name when provider is " transip"
@@ -556,9 +590,9 @@ external-dns: ovh.applicationSecret
556590Return the ExternalDNS service account name
557591*/} }
558592{ {- define " external-dns.serviceAccountName" -} }
559- { {- if .Values.rbac.serviceAccountName -} }
560- { {- printf " %s " (tpl .Values.rbac.serviceAccountName . ) - } }
593+ { {- if .Values.serviceAccount.create -} }
594+ { { default ( include " external-dns.fullname " .) .Values.serviceAccount.name } }
561595{ {- else -} }
562- { {- printf " %s " ( include " external-dns.fullname " . ) - } }
596+ { { default " default " .Values.serviceAccount.name } }
563597{ {- end -} }
564598{ {- end -} }
0 commit comments