Skip to content

Commit

Permalink
Create unique lease obj for each NIC installed via Helm (#6372)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjngx authored Sep 10, 2024
1 parent e3e0b33 commit e6b9db3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
13 changes: 13 additions & 0 deletions charts/nginx-ingress/templates/controller-lease.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{ if .Values.controller.reportIngressStatus.enableLeaderElection }}
apiVersion: coordination.k8s.io/v1
kind: Lease
metadata:
name: {{ include "nginx-ingress.leaderElectionName" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "nginx-ingress.labels" . | nindent 4 }}
{{- if .Values.controller.reportIngressStatus.annotations }}
annotations
{{ toYaml .Values.controller.reportIngressStatus.annotations | indent 4 }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/nginx-ingress/templates/controller-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ rules:
resources:
- leases
resourceNames:
- {{ .Values.controller.reportIngressStatus.leaderElectionLockName }}
- {{ include "nginx-ingress.leaderElectionName" . }}
verbs:
- get
- update
Expand Down
3 changes: 2 additions & 1 deletion charts/nginx-ingress/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,8 @@ controller:
enableLeaderElection: true

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

## The annotations of the leader election configmap.
annotations: {}
Expand Down

0 comments on commit e6b9db3

Please sign in to comment.