Skip to content

Commit

Permalink
added imagePullPolicy for images in values.yaml (#2310)
Browse files Browse the repository at this point in the history
* added imagePullPolicy for images in values.yaml

* fix: renamed pullPolicy key according to image

* fixed dafault always in tmpl

* changed structure of image in yaml

* revert changes

* added global imagePullPolicy

* fixed typo

* added changelog file
  • Loading branch information
aahel committed Jun 14, 2023
1 parent 97c4877 commit fb86424
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/2310.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:feature
helm: Added imagePullPolicy global field which can be configured to override the default behaviour.
```
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ spec:
containers:
- name: api-gateway-controller
image: {{ .Values.apiGateway.image }}
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
ports:
- containerPort: 9090
name: sds
Expand Down Expand Up @@ -219,6 +220,7 @@ spec:
{{- if .Values.global.acls.manageSystemACLs }}
- name: copy-consul-bin
image: {{ .Values.global.image | quote }}
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
command:
- cp
- /bin/consul
Expand Down Expand Up @@ -256,6 +258,7 @@ spec:
{{- end}}
{{- include "consul.consulK8sConsulServerEnvVars" . | nindent 8 }}
image: {{ .Values.global.imageK8S }}
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
volumeMounts:
- mountPath: /consul/login
name: consul-data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ spec:
image:
consulAPIGateway: {{ .Values.apiGateway.image }}
envoy: {{ .Values.apiGateway.imageEnvoy }}
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
{{- if .Values.apiGateway.managedGatewayClass.nodeSelector }}
nodeSelector:
{{ tpl .Values.apiGateway.managedGatewayClass.nodeSelector . | indent 4 | trim }}
Expand Down
1 change: 1 addition & 0 deletions charts/consul/templates/client-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ spec:
{{- if .Values.global.acls.manageSystemACLs }}
- name: client-acl-init
image: {{ .Values.global.imageK8S }}
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
env:
- name: NAMESPACE
valueFrom:
Expand Down
1 change: 1 addition & 0 deletions charts/consul/templates/cni-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ spec:
# This container installs the consul CNI binaries and CNI network config file on each node
- name: install-cni
image: {{ .Values.global.imageK8S }}
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
securityContext:
privileged: true
command:
Expand Down
1 change: 1 addition & 0 deletions charts/consul/templates/enterprise-license-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ spec:
initContainers:
- name: ent-license-acl-init
image: {{ .Values.global.imageK8S }}
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
command:
- "/bin/sh"
- "-ec"
Expand Down
2 changes: 2 additions & 0 deletions charts/consul/templates/mesh-gateway-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ spec:
initContainers:
- name: mesh-gateway-init
image: {{ .Values.global.imageK8S }}
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
env:
- name: NAMESPACE
valueFrom:
Expand Down Expand Up @@ -179,6 +180,7 @@ spec:
containers:
- name: mesh-gateway
image: {{ .Values.global.imageConsulDataplane | quote }}
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
{{- if .Values.meshGateway.resources }}
resources:
{{- if eq (typeOf .Values.meshGateway.resources) "string" }}
Expand Down
1 change: 1 addition & 0 deletions charts/consul/templates/partition-init-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ spec:
containers:
- name: partition-init-job
image: {{ .Values.global.imageK8S }}
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
env:
{{- include "consul.consulK8sConsulServerEnvVars" . | nindent 10 }}
{{- if (and .Values.global.acls.bootstrapToken.secretName .Values.global.acls.bootstrapToken.secretKey) }}
Expand Down
1 change: 1 addition & 0 deletions charts/consul/templates/server-acl-init-cleanup-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ spec:
containers:
- name: server-acl-init-cleanup
image: {{ .Values.global.imageK8S }}
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
command:
- consul-k8s-control-plane
args:
Expand Down
1 change: 1 addition & 0 deletions charts/consul/templates/server-acl-init-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ spec:
containers:
- name: server-acl-init-job
image: {{ .Values.global.imageK8S }}
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
env:
- name: NAMESPACE
valueFrom:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ spec:
-deployment-name={{ template "consul.fullname" . }}-webhook-cert-manager \
-deployment-namespace={{ .Release.Namespace }}
image: {{ .Values.global.imageK8S }}
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
name: webhook-cert-manager
resources:
limits:
Expand Down
6 changes: 6 additions & 0 deletions charts/consul/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ global:
# Changing the partition name would require an un-install and a re-install with the updated name.
# Must be "default" in the server cluster ie the Kubernetes cluster that the Consul server pods are deployed onto.
name: "default"

# Set imagePullPolicy for all images used. This is applies to all the images being used.
# One of "IfNotPresent", "Always", "Never"
# Refer to https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy
# @type: string
imagePullPolicy: ""

# The name (and tag) of the Consul Docker image for clients and servers.
# This can be overridden per component. This should be pinned to a specific
Expand Down

0 comments on commit fb86424

Please sign in to comment.