Skip to content

Commit

Permalink
[metricbeat] fix deployment upgrade by removing chart label from .spe…
Browse files Browse the repository at this point in the history
…c.selector.matchLabels (elastic#622)

This fix metricbeat chart upgrades when .Chart.Version change.

UPGRADE FAILED
Error: Deployment.apps "metricbeat-metricbeat-metrics" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app":"metricbeat-metricbeat-metrics", "chart":"metricbeat-7.7.0", "heritage":"Tiller", "release":"metricbeat"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable
Error: UPGRADE FAILED: Deployment.apps "metricbeat-metricbeat-metrics" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app":"metricbeat-metricbeat-metrics", "chart":"metricbeat-7.7.0", "heritage":"Tiller", "release":"metricbeat"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable

See helm/charts#7680 for more details
  • Loading branch information
jmlrt committed May 18, 2020
1 parent e0cf8c1 commit fe52a62
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
11 changes: 11 additions & 0 deletions BREAKING_CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
- [GA support](#ga-support)
- [New branching model](#new-branching-model)
- [Filebeat container inputs](#filebeat-container-inputs)
- [Metricbeat upgrade issue](#metricbeat-upgrade-issue)
- [Metricbeat split values for daemonset and deployment](#metricbeat-split-values-for-daemonset-and-deployment)
- [6.8.9 - 2020/05/13](#689---20200513)
- [7.6.2 - 2020/03/31](#762---20200331)
- [Kibana default resources](#kibana-default-resources)
- [7.6.0 - 2020/02/11](#760---20200211)
Expand Down Expand Up @@ -48,6 +50,14 @@ Docker images
Filebeat chart default config is now using [container input][] instead of
[docker input][] in [#568][].

### Metricbeat upgrade issue

Metricbeat upgrade are failing with
`spec.selector: Invalid value: ... field is immutable` error. This is related to
Metricbeat deployment selector including chart version which is not immutable.
You should use `helm upgrade --force` to upgrade Metricbeat. See [#621][] for
more details.

### Metricbeat split values for daemonset and deployment

Metricbeat is now using dedicated values for daemonset and deployment config.
Expand Down Expand Up @@ -153,6 +163,7 @@ volumeClaimTemplate:
[#540]: https://github.com/elastic/helm-charts/pull/540
[#568]: https://github.com/elastic/helm-charts/pull/568
[#572]: https://github.com/elastic/helm-charts/pull/572
[#621]: https://github.com/elastic/helm-charts/pull/621
[container input]: https://www.elastic.co/guide/en/beats/filebeat/7.7/filebeat-input-container.html
[docker input]: https://www.elastic.co/guide/en/beats/filebeat/7.7/filebeat-input-docker.html
[elastic helm repo]: https://helm.elastic.co
Expand Down
3 changes: 1 addition & 2 deletions metricbeat/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ spec:
selector:
matchLabels:
app: '{{ template "metricbeat.fullname" . }}-metrics'
chart: '{{ .Chart.Name }}-{{ .Chart.Version }}'
heritage: '{{ .Release.Service }}'
release: '{{ .Release.Name }}'
template:
Expand Down Expand Up @@ -119,4 +118,4 @@ spec:
{{- end }}
{{- if .Values.extraContainers }}
{{ tpl .Values.extraContainers . | indent 6 }}
{{- end }}
{{- end }}

0 comments on commit fe52a62

Please sign in to comment.