Skip to content

Commit e6b9db3

Browse files
authored
Create unique lease obj for each NIC installed via Helm (#6372)
1 parent e3e0b33 commit e6b9db3

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{ if .Values.controller.reportIngressStatus.enableLeaderElection }}
2+
apiVersion: coordination.k8s.io/v1
3+
kind: Lease
4+
metadata:
5+
name: {{ include "nginx-ingress.leaderElectionName" . }}
6+
namespace: {{ .Release.Namespace }}
7+
labels:
8+
{{- include "nginx-ingress.labels" . | nindent 4 }}
9+
{{- if .Values.controller.reportIngressStatus.annotations }}
10+
annotations
11+
{{ toYaml .Values.controller.reportIngressStatus.annotations | indent 4 }}
12+
{{- end }}
13+
{{- end }}

charts/nginx-ingress/templates/controller-role.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ rules:
4343
resources:
4444
- leases
4545
resourceNames:
46-
- {{ .Values.controller.reportIngressStatus.leaderElectionLockName }}
46+
- {{ include "nginx-ingress.leaderElectionName" . }}
4747
verbs:
4848
- get
4949
- update

charts/nginx-ingress/values.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,8 @@ controller:
496496
enableLeaderElection: true
497497

498498
## Specifies the name to be used as the lock for leader election. controller.reportIngressStatus.enableLeaderElection must be set to true.
499-
leaderElectionLockName: "nginx-ingress-leader"
499+
## The default is autogenerated.
500+
leaderElectionLockName: ""
500501

501502
## The annotations of the leader election configmap.
502503
annotations: {}

0 commit comments

Comments
 (0)