From 85ed9f3d4b876ea7c91024c7f03789830d4508a9 Mon Sep 17 00:00:00 2001 From: Franz Beltran <32735684+franzbeltran@users.noreply.github.com> Date: Thu, 9 Nov 2017 10:35:24 +0800 Subject: [PATCH] Update best practices on imagePullPolicy Setting the value of `imagePullPolicy` should be aligned to what `helm create` does --- docs/chart_best_practices/pods.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/chart_best_practices/pods.md b/docs/chart_best_practices/pods.md index de679f9f5..3f26b0253 100644 --- a/docs/chart_best_practices/pods.md +++ b/docs/chart_best_practices/pods.md @@ -30,12 +30,21 @@ image: "{{ .Values.redisImage }}:{{ .Values.redisTag }}" ## ImagePullPolicy -The `imagePullPolicy` should default to an empty value, but allow users to override it: +`helm create` sets the `imagePullPolicy` to `IfNotPresent` by default by doing the following in your `deployment.yaml`: ```yaml -imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }} +imagePullPolicy: {{ .Values.image.pullPolicy }} ``` +And `values.yaml`: + +```yaml +pullPolicy: IfNotPresent +``` + +Similarly, Kubernetes defaults the `imagePullPolicy` to `IfNotPresent` if it is not defined at all. If you want a value other than `IfNotPresent`, simply update the value in `values.yaml` to your desired value. + + ## PodTemplates Should Declare Selectors All PodTemplate sections should specify a selector. For example: