Skip to content

Commit 43f3624

Browse files
authoredApr 15, 2024··
bitnami/external-dns Add support for OCI IAM instance principle and workload identity (#24708)
* Add support for OCI IAM Signed-off-by: cloudoutloud <39462069+cloudoutloud@users.noreply.github.com> * bump minor chart version Signed-off-by: cloudoutloud <39462069+cloudoutloud@users.noreply.github.com> * revert readme Signed-off-by: cloudoutloud <39462069+cloudoutloud@users.noreply.github.com> * update readme Signed-off-by: cloudoutloud <39462069+cloudoutloud@users.noreply.github.com> * Add if statement Signed-off-by: cloudoutloud <39462069+cloudoutloud@users.noreply.github.com> * Add compartment id flag for instance principle Signed-off-by: cloudoutloud <39462069+cloudoutloud@users.noreply.github.com> * Update helpers and values Signed-off-by: cloudoutloud <39462069+cloudoutloud@users.noreply.github.com> --------- Signed-off-by: cloudoutloud <39462069+cloudoutloud@users.noreply.github.com>
1 parent eb1ef30 commit 43f3624

File tree

6 files changed

+27
-5
lines changed

6 files changed

+27
-5
lines changed
 

‎bitnami/external-dns/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ maintainers:
2828
name: external-dns
2929
sources:
3030
- https://github.com/bitnami/charts/tree/main/bitnami/external-dns
31-
version: 7.1.2
31+
version: 7.2.0

‎bitnami/external-dns/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,8 @@ helm install my-release \
262262
| `oci.privateKeyFingerprint` | When using the OCI provider, put in the fingerprint of your privateKey | `""` |
263263
| `oci.privateKeyPassphrase` | When using the OCI provider and your privateKey has a passphrase, put it in here. (optional) | `""` |
264264
| `oci.secretName` | When using the OCI provider, it's the name of the secret containing `oci.yaml` file. | `""` |
265+
| `oci.useInstancePrincipal` | When using the OCI provider, enable IAM Instance Principal | `false` |
266+
| `oci.useWorkloadIdentity` | When using the OCI provider, enable IAM Workload Identity | `false` |
265267
| `ovh.consumerKey` | When using the OVH provider, specify the existing consumer key. (required when provider=ovh and `ovh.secretName` is not provided.) | `""` |
266268
| `ovh.applicationKey` | When using the OVH provider with an existing application, specify the application key. (required when provider=ovh and `ovh.secretName` is not provided.) | `""` |
267269
| `ovh.applicationSecret` | When using the OVH provider with an existing application, specify the application secret. (required when provider=ovh and `ovh.secretName` is not provided.) | `""` |

‎bitnami/external-dns/templates/_helpers.tpl

+8-1
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,12 @@ region = {{ .Values.aws.region }}
257257
}
258258
{{ end }}
259259
{{- define "external-dns.oci-credentials" -}}
260+
{{- if .Values.oci.useWorkloadIdentity }}
261+
auth:
262+
region: {{ .Values.oci.region }}
263+
useWorkloadIdentity: true
264+
compartment: {{ .Values.oci.compartmentOCID }}
265+
{{- else }}
260266
auth:
261267
region: {{ .Values.oci.region }}
262268
tenancy: {{ .Values.oci.tenancyOCID }}
@@ -268,7 +274,8 @@ auth:
268274
passphrase: {{ .Values.oci.privateKeyPassphrase }}
269275
{{- end }}
270276
compartment: {{ .Values.oci.compartmentOCID }}
271-
{{ end }}
277+
{{- end }}
278+
{{- end }}
272279

273280
{{/*
274281
Compile all warnings into a single message, and call fail if the validation is enabled

‎bitnami/external-dns/templates/dep-ds.yaml

+9-2
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,13 @@ spec:
282282
- --infoblox-max-results={{ .Values.infoblox.maxResults }}
283283
{{- end }}
284284
{{- end }}
285+
{{- if and (eq .Values.provider "oci") .Values.oci.useInstancePrincipal }}
286+
# OCI Arguments
287+
- --oci-auth-instance-principal
288+
{{- if .Values.oci.compartmentOCID }}
289+
- --oci-compartment-ocid={{ .Values.oci.compartmentOCID }}
290+
{{- end }}
291+
{{- end }}
285292
{{- if eq .Values.provider "ns1" }}
286293
# ns1 arguments
287294
- --ns1-min-ttl={{ .Values.ns1.minTTL }}
@@ -782,7 +789,7 @@ spec:
782789
- name: google-service-account
783790
mountPath: /etc/secrets/service-account/
784791
{{- end }}
785-
{{- if eq .Values.provider "oci" }}
792+
{{- if and (eq .Values.provider "oci") (not .Values.oci.useInstancePrincipal) }}
786793
- name: oci-config-file
787794
mountPath: /etc/kubernetes/
788795
{{- end }}
@@ -851,7 +858,7 @@ spec:
851858
type: File
852859
{{- end }}
853860
{{- end }}
854-
{{- if (eq .Values.provider "oci")}}
861+
{{- if and (eq .Values.provider "oci") (not .Values.oci.useInstancePrincipal) }}
855862
- name: oci-config-file
856863
secret:
857864
secretName: {{ template "external-dns.secretName" . }}

‎bitnami/external-dns/templates/secret.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ data:
7575
{{- if eq .Values.provider "linode" }}
7676
linode_api_token: {{ .Values.linode.apiToken | b64enc | quote }}
7777
{{- end }}
78-
{{- if eq .Values.provider "oci" }}
78+
{{- if and (eq .Values.provider "oci") (not .Values.useInstancePrincipal) }}
7979
oci.yaml: {{ include "external-dns.oci-credentials" . | b64enc | quote }}
8080
{{- end }}
8181
{{- if eq .Values.provider "pdns" }}

‎bitnami/external-dns/values.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,12 @@ oci:
612612
## Ref: https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/oracle.md#deploy-externaldns
613613
##
614614
secretName: ""
615+
## @param oci.useInstancePrincipal When using the OCI provider, enable IAM Instance Principal
616+
## Ref: https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/oracle.md#oci-iam-instance-principal
617+
useInstancePrincipal: false
618+
## @param oci.useWorkloadIdentity When using the OCI provider, enable IAM Workload Identity
619+
## Ref: https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/oracle.md#oci-iam-instance-principal
620+
useWorkloadIdentity: false
615621
## OVH configuration to be set via arguments/env. variables
616622
##
617623
ovh:

0 commit comments

Comments
 (0)
Please sign in to comment.