-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Controller: Correctly identify other pods on shutdown. #13444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
DerekTBrown marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Changelog | ||
|
||
This file documents all notable changes to [ingress-nginx](https://github.com/kubernetes/ingress-nginx) Helm Chart. The release numbering uses [semantic versioning](http://semver.org). | ||
|
||
### 4.12.3 | ||
|
||
* Add electionID label to controller pods when leader election is enabled | ||
|
||
**Full Changelog**: https://github.com/kubernetes/ingress-nginx/compare/helm-chart-4.12.2...helm-chart-4.12.3 |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -34,6 +34,9 @@ spec: | |||||
labels: | ||||||
{{- include "ingress-nginx.labels" . | nindent 8 }} | ||||||
app.kubernetes.io/component: controller | ||||||
{{- if not .Values.controller.disableLeaderElection }} | ||||||
nginx.ingress.kubernetes.io/electionID: {{ include "ingress-nginx.controller.electionID" . }} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if camel case is the way to go here...
Suggested change
|
||||||
{{- end }} | ||||||
{{- with .Values.controller.labels }} | ||||||
{{- toYaml . | nindent 8 }} | ||||||
{{- end }} | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -40,6 +40,9 @@ spec: | |||||
labels: | ||||||
{{- include "ingress-nginx.labels" . | nindent 8 }} | ||||||
app.kubernetes.io/component: controller | ||||||
{{- if not .Values.controller.disableLeaderElection }} | ||||||
nginx.ingress.kubernetes.io/electionID: {{ include "ingress-nginx.controller.electionID" . }} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here:
Suggested change
|
||||||
{{- end }} | ||||||
{{- with .Values.controller.labels }} | ||||||
{{- toYaml . | nindent 8 }} | ||||||
{{- end }} | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -208,3 +208,30 @@ tests: | |||||
- equal: | ||||||
path: spec.template.spec.runtimeClassName | ||||||
value: myClass | ||||||
|
||||||
- it: should create a DaemonSet with the electionID label on the pod template when leader election is enabled | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
set: | ||||||
controller.kind: DaemonSet | ||||||
controller.disableLeaderElection: false | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd actually omit explicitly setting this, so the test fails as soon as someone changes the default. |
||||||
asserts: | ||||||
- equal: | ||||||
path: spec.template.metadata.labels.[nginx.ingress.kubernetes.io/electionID] | ||||||
value: RELEASE-NAME-ingress-nginx-leader | ||||||
|
||||||
- it: should create a DaemonSet with the custom electionID label on the pod template when controller.electionID is set and leader election is enabled | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
set: | ||||||
controller.kind: DaemonSet | ||||||
controller.disableLeaderElection: false | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here: I'd actually omit explicitly setting this, so the test fails as soon as someone changes the default. |
||||||
controller.electionID: custom-election-id | ||||||
asserts: | ||||||
- equal: | ||||||
path: spec.template.metadata.labels.[nginx.ingress.kubernetes.io/electionID] | ||||||
value: custom-election-id | ||||||
|
||||||
- it: should create a DaemonSet without the electionID label on the pod template when leader election is disabled | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
set: | ||||||
controller.kind: DaemonSet | ||||||
controller.disableLeaderElection: true | ||||||
asserts: | ||||||
- notExists: | ||||||
path: spec.template.metadata.labels.[nginx.ingress.kubernetes.io/electionID] |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here as for the DaemonSet tests. |
Uh oh!
There was an error while loading. Please reload this page.