From 7d2b14da452277a63c4c98e5176f79663af2cb28 Mon Sep 17 00:00:00 2001 From: Maciej Strzelecki Date: Thu, 22 Dec 2016 00:28:42 +0100 Subject: [PATCH] Set default imagePullPolicy to IfNotPresent (#325) * Set default imagePullPolicy to IfNotPresent Fixes #295 for MySQL chart in the same way as #309 does it for MariaDB. Related to kubernetes/kubernetes#38542. PS I've changed `pod.alpha.kubernetes.io/init-containers` to `pod.beta.kubernetes.io/init-containers`. * Update docs about updating images --- stable/mysql/Chart.yaml | 2 +- stable/mysql/README.md | 2 +- stable/mysql/templates/deployment.yaml | 7 ++++--- stable/mysql/values.yaml | 8 ++++---- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/stable/mysql/Chart.yaml b/stable/mysql/Chart.yaml index 9ca0cd795c..26336ad086 100644 --- a/stable/mysql/Chart.yaml +++ b/stable/mysql/Chart.yaml @@ -1,5 +1,5 @@ name: mysql -version: 0.2.2 +version: 0.2.3 description: Chart for MySQL keywords: - mysql diff --git a/stable/mysql/README.md b/stable/mysql/README.md index 37a03dec18..6865221caa 100644 --- a/stable/mysql/README.md +++ b/stable/mysql/README.md @@ -47,7 +47,7 @@ The following tables lists the configurable parameters of the MySQL chart and th | Parameter | Description | Default | | ----------------------- | ---------------------------------- | ---------------------------------------------------------- | | `imageTag` | `mysql` image tag. | Most recent release | -| `imagePullPolicy` | Image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent` | +| `imagePullPolicy` | Image pull policy | `IfNotPresent` | | `mysqlRootPassword` | Password for the `root` user. | `nil` | | `mysqlUser` | Username of new user to create. | `nil` | | `mysqlPassword` | Password for the new user. | `nil` | diff --git a/stable/mysql/templates/deployment.yaml b/stable/mysql/templates/deployment.yaml index 6c382ef5a1..95bbefa7cd 100644 --- a/stable/mysql/templates/deployment.yaml +++ b/stable/mysql/templates/deployment.yaml @@ -13,7 +13,7 @@ spec: labels: app: {{ template "fullname" . }} annotations: - pod.alpha.kubernetes.io/init-containers: '[ + pod.beta.kubernetes.io/init-containers: '[ { "name": "remove-lost-found", "image": "busybox:1.25.0", @@ -23,14 +23,15 @@ spec: "name": "data", "mountPath": "/var/lib/mysql" } - ] + ], + "imagePullPolicy": {{ .Values.imagePullPolicy | quote }} } ]' spec: containers: - name: {{ template "fullname" . }} image: "mysql:{{ .Values.imageTag }}" - imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }} + imagePullPolicy: {{ .Values.imagePullPolicy | quote }} resources: {{ toYaml .Values.resources | indent 10 }} env: diff --git a/stable/mysql/values.yaml b/stable/mysql/values.yaml index 962100918b..91e2b8cbc5 100644 --- a/stable/mysql/values.yaml +++ b/stable/mysql/values.yaml @@ -21,11 +21,11 @@ imageTag: "5.7.14" ## # mysqlDatabase: -## Specify a imagePullPolicy -## 'Always' if imageTag is 'latest', else set to 'IfNotPresent' -## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images +## Specify an imagePullPolicy (Required) +## It's recommended to change this to 'Always' if the image tag is 'latest' +## ref: http://kubernetes.io/docs/user-guide/images/#updating-images ## -# imagePullPolicy: +imagePullPolicy: IfNotPresent ## Persist data to a persitent volume persistence: