Skip to content

Commit 54d6f9c

Browse files
desaintmartinwgiddens
authored andcommitted
[stable/redis] Major version bump: Fix chart not being upgradable by removing 'chart' label from spec.selector or spec.VolumeClaimTemplate. (helm#7686)
Also set a selector to all Deployments. See helm#7680. Signed-off-by: Cédric de Saint Martin <[email protected]>
1 parent 8f2bff5 commit 54d6f9c

File tree

5 files changed

+36
-3
lines changed

5 files changed

+36
-3
lines changed

stable/redis/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: redis
2-
version: 3.10.0
2+
version: 4.0.0
33
appVersion: 4.0.11
44
description: Open source, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.
55
keywords:

stable/redis/README.md

+25
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,31 @@ $ helm delete my-release
4545

4646
The command removes all the Kubernetes components associated with the chart and deletes the release.
4747

48+
## Upgrading an existing Release to a new major version
49+
50+
A major chart version change (like v1.2.3 -> v2.0.0) indicates that there is an
51+
incompatible breaking change needing manual actions.
52+
53+
### 4.0.0
54+
55+
This version removes the `chart` label from the `spec.selector.matchLabels`
56+
which is immutable since `StatefulSet apps/v1beta2`. It has been inadvertently
57+
added, causing any subsequent upgrade to fail. See https://github.com/helm/charts/issues/7726.
58+
59+
It also fixes https://github.com/helm/charts/issues/7726 where a deployment `extensions/v1beta1` can not be upgraded if `spec.selector` is not explicitely set.
60+
61+
Finally, it fixes https://github.com/helm/charts/issues/7803 by removing mutable labels in `spec.VolumeClaimTemplate.metadata.labels` so that it is upgradable.
62+
63+
In order to upgrade, delete the Redis StatefulSet before upgrading:
64+
```bash
65+
$ kubectl delete statefulsets.apps --cascade=false my-release-redis-master
66+
```
67+
And edit the Redis slave (and metrics if enabled) deployment:
68+
```bash
69+
kubectl patch deployments my-release-redis-slave --type=json -p='[{"op": "remove", "path": "/spec/selector/matchLabels/chart"}]'
70+
kubectl patch deployments my-release-redis-metrics --type=json -p='[{"op": "remove", "path": "/spec/selector/matchLabels/chart"}]'
71+
```
72+
4873
## Configuration
4974

5075
The following table lists the configurable parameters of the Redis chart and their default values.

stable/redis/templates/metrics-deployment.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ metadata:
99
release: "{{ .Release.Name }}"
1010
heritage: "{{ .Release.Service }}"
1111
spec:
12+
selector:
13+
matchLabels:
14+
release: "{{ .Release.Name }}"
15+
role: metrics
16+
app: {{ template "redis.name" . }}
1217
template:
1318
metadata:
1419
labels:

stable/redis/templates/redis-master-statefulset.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ spec:
1111
selector:
1212
matchLabels:
1313
release: "{{ .Release.Name }}"
14-
chart: {{ template "redis.chart" . }}
1514
role: master
1615
app: {{ template "redis.name" . }}
1716
serviceName: "redis-master"
@@ -161,7 +160,6 @@ spec:
161160
name: redis-data
162161
labels:
163162
app: "{{ template "redis.name" . }}"
164-
chart: {{ template "redis.chart" . }}
165163
component: "master"
166164
release: {{ .Release.Name | quote }}
167165
heritage: {{ .Release.Service | quote }}

stable/redis/templates/redis-slave-deployment.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ spec:
1212
{{- if .Values.cluster.slaveCount }}
1313
replicas: {{ .Values.cluster.slaveCount }}
1414
{{- end }}
15+
selector:
16+
matchLabels:
17+
release: "{{ .Release.Name }}"
18+
role: slave
19+
app: {{ template "redis.name" . }}
1520
template:
1621
metadata:
1722
labels:

0 commit comments

Comments
 (0)