-
Notifications
You must be signed in to change notification settings - Fork 270
Rework labels in Opensearch chart to match standard recommendations #37
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,22 +4,14 @@ kind: StatefulSet | |
| metadata: | ||
| name: {{ template "opensearch.uname" . }} | ||
| labels: | ||
| heritage: {{ .Release.Service | quote }} | ||
| release: {{ .Release.Name | quote }} | ||
| chart: "{{ .Chart.Name }}" | ||
| app: "{{ template "opensearch.uname" . }}" | ||
| {{- range $key, $value := .Values.labels }} | ||
| {{ $key }}: {{ $value | quote }} | ||
| {{- end }} | ||
| {{- include "opensearch.labels" . | nindent 4 }} | ||
|
Collaborator
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. See previous comment, if I remember correctly. Statefulsets will not allow updates to the spec other than the template, replicas and updateStrat. So, if someone upgraded this would break.
Contributor
Author
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. The
Collaborator
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. @smlx Let me triple check this right now. |
||
| annotations: | ||
| majorVersion: "{{ include "opensearch.majorVersion" . }}" | ||
| spec: | ||
| serviceName: {{ template "opensearch.uname" . }}-headless | ||
| selector: | ||
| matchLabels: | ||
| release: {{ .Release.Name | quote }} | ||
| chart: "{{ .Chart.Name }}" | ||
| app: "{{ template "opensearch.uname" . }}" | ||
| {{- include "opensearch.selectorLabels" . | nindent 6 }} | ||
|
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. This change breaks upgrades for statefulsets. I just ran into this upgrading from 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. Error: UPGRADE FAILED: cannot patch "opensearch-1-master" with kind StatefulSet: StatefulSet.apps "opensearch-1-master" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', and 'updateStrategy' are forbidden
Contributor
Author
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. Yes sorry this PR should have been a major version bump.
Contributor
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. Agreed.
Collaborator
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. @smlx I was right! #37 (comment)
Contributor
Author
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. yes I didn't consider upgrading from previous versions - only going forward from this change. 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 was able to delete the statefulset and rerun
Contributor
Author
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. thanks @acjohnson for sharing your workaround and sorry for the breakage! 🙏 |
||
| replicas: {{ .Values.replicas }} | ||
| podManagementPolicy: {{ .Values.podManagementPolicy }} | ||
| updateStrategy: | ||
|
|
@@ -30,12 +22,7 @@ spec: | |
| name: {{ template "opensearch.uname" . }} | ||
| {{- if .Values.persistence.labels.enabled }} | ||
| labels: | ||
| release: {{ .Release.Name | quote }} | ||
| chart: "{{ .Chart.Name }}" | ||
| app: "{{ template "opensearch.uname" . }}" | ||
| {{- range $key, $value := .Values.labels }} | ||
| {{ $key }}: {{ $value | quote }} | ||
| {{- end }} | ||
| {{- include "opensearch.labels" . | nindent 8 }} | ||
| {{- end }} | ||
| {{- with .Values.persistence.annotations }} | ||
| annotations: | ||
|
|
@@ -61,12 +48,7 @@ spec: | |
| metadata: | ||
| name: "{{ template "opensearch.uname" . }}" | ||
| labels: | ||
| release: {{ .Release.Name | quote }} | ||
| chart: "{{ .Chart.Name }}" | ||
| app: "{{ template "opensearch.uname" . }}" | ||
| {{- range $key, $value := .Values.labels }} | ||
| {{ $key }}: {{ $value | quote }} | ||
| {{- end }} | ||
| {{- include "opensearch.labels" . | nindent 8 }} | ||
| annotations: | ||
| {{- range $key, $value := .Values.podAnnotations }} | ||
| {{ $key }}: {{ $value | quote }} | ||
|
|
@@ -113,10 +95,14 @@ spec: | |
| requiredDuringSchedulingIgnoredDuringExecution: | ||
| - labelSelector: | ||
| matchExpressions: | ||
| - key: app | ||
| - key: app.kubernetes.io/instance | ||
| operator: In | ||
| values: | ||
| - "{{ template "opensearch.uname" .}}" | ||
| - {{ .Release.Name }} | ||
| - key: app.kubernetes.io/name | ||
| operator: In | ||
| values: | ||
| - {{ include "opensearch.name" . }} | ||
| topologyKey: {{ .Values.antiAffinityTopologyKey }} | ||
| {{- else if eq .Values.antiAffinity "soft" }} | ||
| podAntiAffinity: | ||
|
|
@@ -126,10 +112,14 @@ spec: | |
| topologyKey: {{ .Values.antiAffinityTopologyKey }} | ||
| labelSelector: | ||
| matchExpressions: | ||
| - key: app | ||
| - key: app.kubernetes.io/instance | ||
| operator: In | ||
| values: | ||
| - {{ .Release.Name }} | ||
| - key: app.kubernetes.io/name | ||
| operator: In | ||
| values: | ||
| - "{{ template "opensearch.uname" . }}" | ||
| - {{ include "opensearch.name" . }} | ||
| {{- end }} | ||
| {{- with .Values.nodeAffinity }} | ||
| nodeAffinity: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break the statefulset if you try to deploy with an upgraded version, won't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did test updating the
appVersionand it seems to work. How do you see it breaking?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smlx Can you resolve this conversation?