Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

[stable/redis] Major version bump: Fix chart not being upgradable #7686

Merged
merged 1 commit into from
Sep 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stable/redis/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: redis
version: 3.10.0
version: 4.0.0
appVersion: 4.0.11
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.
keywords:
Expand Down
25 changes: 25 additions & 0 deletions stable/redis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,31 @@ $ helm delete my-release

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

## Upgrading an existing Release to a new major version

A major chart version change (like v1.2.3 -> v2.0.0) indicates that there is an
incompatible breaking change needing manual actions.

### 4.0.0

This version removes the `chart` label from the `spec.selector.matchLabels`
which is immutable since `StatefulSet apps/v1beta2`. It has been inadvertently
desaintmartin marked this conversation as resolved.
Show resolved Hide resolved
added, causing any subsequent upgrade to fail. See https://github.com/helm/charts/issues/7726.

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.

Finally, it fixes https://github.com/helm/charts/issues/7803 by removing mutable labels in `spec.VolumeClaimTemplate.metadata.labels` so that it is upgradable.

In order to upgrade, delete the Redis StatefulSet before upgrading:
```bash
$ kubectl delete statefulsets.apps --cascade=false my-release-redis-master
```
And edit the Redis slave (and metrics if enabled) deployment:
```bash
kubectl patch deployments my-release-redis-slave --type=json -p='[{"op": "remove", "path": "/spec/selector/matchLabels/chart"}]'
kubectl patch deployments my-release-redis-metrics --type=json -p='[{"op": "remove", "path": "/spec/selector/matchLabels/chart"}]'
```

## Configuration

The following table lists the configurable parameters of the Redis chart and their default values.
Expand Down
5 changes: 5 additions & 0 deletions stable/redis/templates/metrics-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ metadata:
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
selector:
matchLabels:
release: "{{ .Release.Name }}"
role: metrics
app: {{ template "redis.name" . }}
template:
metadata:
labels:
Expand Down
2 changes: 0 additions & 2 deletions stable/redis/templates/redis-master-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ spec:
selector:
matchLabels:
release: "{{ .Release.Name }}"
chart: {{ template "redis.chart" . }}
role: master
app: {{ template "redis.name" . }}
serviceName: "redis-master"
Expand Down Expand Up @@ -161,7 +160,6 @@ spec:
name: redis-data
labels:
app: "{{ template "redis.name" . }}"
chart: {{ template "redis.chart" . }}
component: "master"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
Expand Down
5 changes: 5 additions & 0 deletions stable/redis/templates/redis-slave-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ spec:
{{- if .Values.cluster.slaveCount }}
replicas: {{ .Values.cluster.slaveCount }}
{{- end }}
selector:
matchLabels:
release: "{{ .Release.Name }}"
role: slave
app: {{ template "redis.name" . }}
template:
metadata:
labels:
Expand Down