[stable/memcached] Update apiVersions for Kubernetes 1.16 (#17627)

Signed-off-by: Andrew Drake <andrew@frontapp.com>
This commit is contained in:
Andrew Drake
2019-10-02 22:26:07 -07:00
committed by Kubernetes Prow Robot
parent 8a3e74d616
commit b666637539
3 changed files with 45 additions and 2 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1
name: memcached
version: 2.10.2
version: 3.0.0
appVersion: 1.5.12
description: Free & open source, high-performance, distributed memory object caching
system.
+39
View File
@@ -84,3 +84,42 @@ $ helm install --name my-release -f values.yaml stable/memcached
```
> **Tip**: You can use the default [values.yaml](values.yaml)
## Upgrading to 3.x from a previous major version
Version 3.0.0 of this chart makes an incompatible change to the way StatefulSet/Deployment selectors are configured. If you try to upgrade from a previous major version, you will see an error like this:
```
Error: UPGRADE FAILED: Deployment.apps "mc-test-memcached" is invalid: spec.template.metadata.labels: Invalid value: map[string]string{"app":"mc-test-memcached", "chart":"memcached-3.0.0", "custom":"value", "heritage":"Tiller", "release":"mc-test"}: `selector` does not match template `labels`
```
To upgrade from a previous major version, you'll either need to perform a small manual fix or delete and reinstall the chart.
The manual fix is to remove all selectors from the existing StatefulSet/Deployment except `app` and `release`. Run `kubectl edit sts|deploy name-goes-here` (as needed), and you should see a part like this in your editor about 20 lines down:
```yaml
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 2
selector:
matchLabels:
app: mc-test-memcached
chart: memcached-2.10.2
heritage: Tiller
release: mc-test
```
Remove the lines under `matchLabels` except `app: ...` and `release: ...`, and don't change any other lines. The part from above should look like this when you're done:
```yaml
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 2
selector:
matchLabels:
app: mc-test-memcached
release: mc-test
```
Once you've done this, you can upgrade to 3.x with Helm as normal.
+5 -1
View File
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: {{ .Values.kind }}
metadata:
name: {{ template "memcached.fullname" . }}
@@ -8,6 +8,10 @@ metadata:
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
selector:
matchLabels:
app: {{ template "memcached.fullname" . }}
release: "{{ .Release.Name }}"
{{- if eq .Values.kind "StatefulSet" }}
serviceName: {{ template "memcached.fullname" . }}
{{- end }}