-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
backlogPull requests/issues that are backlog itemsPull requests/issues that are backlog itemsbugAn issue reporting a potential bugAn issue reporting a potential bugproposalAn issue that proposes a feature requestAn issue that proposes a feature requestrefinedIssues that are ready to be prioritizedIssues that are ready to be prioritized
Milestone
Description
As an engineer, I would like to ensure that users can deploy multiple Ingress Controllers in the same name space without modifying the name of the leaderElectionLockName
.
NOTE: This bug does not cover the lease object being managed by Helm
### UACs:
- [x] Update `_helper.tpl` to only generate the name of the lease
- [x] Update `charts/nginx-ingress/templates/controller-role.yaml` to use `nginx-ingress.leaderElectionName` instead of `.Values.controller.reportIngressStatus.leaderElectionLockName`
Changes required for fulfil requirements
- Update
_helper.tpl
to only generate the name:
Before:
{{- define "nginx-ingress.leaderElectionName" -}}
{{- if .Values.controller.reportIngressStatus.leaderElectionLockName -}}
{{ .Values.controller.reportIngressStatus.leaderElectionLockName }}
{{- else -}}
{{- printf "%s-%s" (include "nginx-ingress.fullname" .) "leader-election" -}}
{{- end -}}
{{- end -}}
After:
{{- define "nginx-ingress.leaderElectionName" -}}
{{- printf "%s-%s" (include "nginx-ingress.fullname" .) "leader-election" -}}
{{- end -}}
Consideration:
{{- define "nginx-ingress.leaderElectionName" -}}
{{- printf "%s-%s" (include "nginx-ingress.fullname" .) .Values.controller.reportIngressStatus.leaderElectionLockName -}}
{{- end -}}
- Update
charts/nginx-ingress/templates/controller-role.yaml
to usenginx-ingress.leaderElectionName
instead of.Values.controller.reportIngressStatus.leaderElectionLockName
Before:
resources:
- leases
resourceNames:
- {{ .Values.controller.reportIngressStatus.leaderElectionLockName }}
After:
resources:
- leases
resourceNames:
- {{ include "nginx-ingress.leaderElectionName" . }}
- Remove
.Values.controller.reportIngressStatus.leaderElectionLockName
fromvalues.yaml
Tested two deployments in the same namespace:
k get leases.coordination.k8s.io
NAME HOLDER AGE
leader-election-test-1-nginx-ingress-leader-election leader-election-test-1-nginx-ingress-controller-75ff476494lbmnc 8m14s
leader-election-test-2-nginx-ingress-leader-election leader-election-test-2-nginx-ingress-controller-7785c4fbc4qbckk 2s
k get deploy | grep leader-election
leader-election-test-1-nginx-ingress-controller 1/1 1 1 8m30s
leader-election-test-2-nginx-ingress-controller 1/1 1 1 17s
Metadata
Metadata
Labels
backlogPull requests/issues that are backlog itemsPull requests/issues that are backlog itemsbugAn issue reporting a potential bugAn issue reporting a potential bugproposalAn issue that proposes a feature requestAn issue that proposes a feature requestrefinedIssues that are ready to be prioritizedIssues that are ready to be prioritized