Skip to content
Open
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
11 changes: 11 additions & 0 deletions helm/ingress-azure/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,15 @@ If release name contains chart name it will be used as a full name.
{{- printf "%s-azidbinding-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Override a secret name for service principal in case you have multiple AGIC controllers.
*/}}
{{- define "application-gateway-kubernetes-ingress.servicePrincipalSecretName" -}}
{{- if .Values.armAuth.secretName -}}
{{- .Values.armAuth.secretName -}}
{{- else -}}
{{- printf "networking-appgw-k8s-azure-service-principal" -}}
{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion helm/ingress-azure/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ spec:
{{- if eq .Values.armAuth.type "servicePrincipal"}}
- name: networking-appgw-k8s-azure-service-principal-mount
secret:
secretName: networking-appgw-k8s-azure-service-principal
secretName: {{ template "application-gateway-kubernetes-ingress.servicePrincipalSecretName" . }}
{{- end}}
{{- end}}
{{- if .Values.kubernetes.volumes }}
Expand Down
2 changes: 1 addition & 1 deletion helm/ingress-azure/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: v1
kind: Secret
metadata:
name: networking-appgw-k8s-azure-service-principal
name: {{ template "application-gateway-kubernetes-ingress.servicePrincipalSecretName" . }}
type: Opaque
data:
armAuth.json: "{{- required "armAuth.secretJSON is required when using servicePrincipal" .Values.armAuth.secretJSON -}}"
Expand Down
1 change: 1 addition & 0 deletions helm/ingress-azure/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ appgw: {}
# # Generate this value with:
# # az ad sp create-for-rbac --subscription <subscription-uuid> --sdk-auth | base64 -w0
# secretJSON: <base64-encoded-JSON-blob>
# secretName: <your-secret-name>
#
# - Option 3: Workload Identity (https://learn.microsoft.com/en-us/azure/aks/workload-identity-overview)
# armAuth:
Expand Down