diff --git a/helm/kolla-common/templates/_common_api_python_deployment.yaml b/helm/kolla-common/templates/_common_api_python_deployment.yaml index 69e44ad05..78826097f 100644 --- a/helm/kolla-common/templates/_common_api_python_deployment.yaml +++ b/helm/kolla-common/templates/_common_api_python_deployment.yaml @@ -84,6 +84,7 @@ spec: {{- if $localVals.haproxy }} - name: haproxy image: {{ include "haproxy_image_full" . | quote }} + imagePullPolicy: {{ $imagePullPolicy | quote }} command: - /bin/bash - -c @@ -127,6 +128,7 @@ spec: {{- end }} - name: main image: "{{ .imageFull }}" + imagePullPolicy: {{ $imagePullPolicy | quote }} {{- if $localVals.haproxy }} lifecycle: preStop: diff --git a/helm/kolla-common/templates/_common_create_db_job.yaml b/helm/kolla-common/templates/_common_create_db_job.yaml index 1e41f6030..6b6378496 100644 --- a/helm/kolla-common/templates/_common_create_db_job.yaml +++ b/helm/kolla-common/templates/_common_create_db_job.yaml @@ -1,4 +1,5 @@ {{- define "common_create_db_job" }} +{{- $imagePullPolicy := include "kolla_val_get_str" (dict "key" "image_pull_policy" "searchPath" .searchPath "Values" .Values ) }} {{- $containerConfigDirectory := include "kolla_val_get_str" (dict "key" "container_config_directory" "searchPath" .searchPath "Values" .Values ) }} {{- $selectorKey := include "kolla_val_get_str" (dict "key" "selector_key" "searchPath" .searchPath "Values" .Values ) }} {{- $selectorValue := include "kolla_val_get_str" (dict "key" "selector_value" "searchPath" .searchPath "Values" .Values ) }} @@ -22,6 +23,7 @@ spec: restartPolicy: OnFailure containers: - image: {{ include "kolla_toolbox_image_full" . | quote }} + imagePullPolicy: {{ $imagePullPolicy | quote }} name: "creating-{{ .serviceName }}-database" command: ["sh", "-c"] args: @@ -44,6 +46,7 @@ spec: name: database-password key: password - image: {{ include "kolla_toolbox_image_full" . | quote }} + imagePullPolicy: {{ $imagePullPolicy | quote }} name: "creating-{{ .serviceName }}-user-and-permissions" command: ["sh", "-c"] args: diff --git a/helm/kolla-common/templates/_common_create_keystone_endpoint.yaml b/helm/kolla-common/templates/_common_create_keystone_endpoint.yaml index 97f1164b3..9618ace0f 100644 --- a/helm/kolla-common/templates/_common_create_keystone_endpoint.yaml +++ b/helm/kolla-common/templates/_common_create_keystone_endpoint.yaml @@ -1,4 +1,5 @@ {{- define "common_create_keystone_endpoint" }} +{{- $imagePullPolicy := include "kolla_val_get_str" (dict "key" "image_pull_policy" "searchPath" .searchPath "Values" .Values ) }} {{- $region := include "kolla_val_get_str" (dict "key" "region" "searchPath" .searchPath "Values" .Values ) }} {{- $selectorKey := include "kolla_val_get_str" (dict "key" "selector_key" "searchPath" .searchPath "Values" .Values ) }} {{- $selectorValue := include "kolla_val_get_str" (dict "key" "selector_value" "searchPath" .searchPath "Values" .Values ) }} @@ -29,6 +30,7 @@ spec: {{ $selectorKey }}: {{ $selectorValue | quote }} containers: - image: {{ include "kolla_toolbox_image_full" . | quote }} + imagePullPolicy: {{ $imagePullPolicy | quote }} name: main command: ["sh", "-xec"] args: diff --git a/helm/kolla-common/templates/_common_create_keystone_service.yaml b/helm/kolla-common/templates/_common_create_keystone_service.yaml index 0a31fa9b6..99a27e638 100644 --- a/helm/kolla-common/templates/_common_create_keystone_service.yaml +++ b/helm/kolla-common/templates/_common_create_keystone_service.yaml @@ -1,4 +1,5 @@ {{- define "common_create_keystone_service" }} +{{- $imagePullPolicy := include "kolla_val_get_str" (dict "key" "image_pull_policy" "searchPath" .searchPath "Values" .Values ) }} {{- $region := include "kolla_val_get_str" (dict "key" "region" "searchPath" .searchPath "Values" .Values ) }} {{- $selectorKey := include "kolla_val_get_str" (dict "key" "selector_key" "searchPath" .searchPath "Values" .Values ) }} {{- $selectorValue := include "kolla_val_get_str" (dict "key" "selector_value" "searchPath" .searchPath "Values" .Values ) }} @@ -29,6 +30,7 @@ spec: {{ $selectorKey }}: {{ $selectorValue | quote }} containers: - image: {{ include "kolla_toolbox_image_full" . | quote }} + imagePullPolicy: {{ $imagePullPolicy | quote }} name: main command: ["sh", "-xec"] args: diff --git a/helm/kolla-common/templates/_common_create_keystone_user.yaml b/helm/kolla-common/templates/_common_create_keystone_user.yaml index da6f4a6de..0bb3096c8 100644 --- a/helm/kolla-common/templates/_common_create_keystone_user.yaml +++ b/helm/kolla-common/templates/_common_create_keystone_user.yaml @@ -1,4 +1,5 @@ {{- define "common_create_keystone_user" }} +{{- $imagePullPolicy := include "kolla_val_get_str" (dict "key" "image_pull_policy" "searchPath" .searchPath "Values" .Values ) }} {{- $region := include "kolla_val_get_str" (dict "key" "region" "searchPath" .searchPath "Values" .Values ) }} {{- $selectorKey := include "kolla_val_get_str" (dict "key" "selector_key" "searchPath" .searchPath "Values" .Values ) }} {{- $selectorValue := include "kolla_val_get_str" (dict "key" "selector_value" "searchPath" .searchPath "Values" .Values ) }} @@ -28,6 +29,7 @@ spec: {{ $selectorKey }}: {{ $selectorValue | quote }} containers: - image: {{ include "kolla_toolbox_image_full" . | quote }} + imagePullPolicy: {{ $imagePullPolicy | quote }} name: main command: ["sh", "-xec"] args: diff --git a/helm/kolla-common/templates/_common_delete_db_job.yaml b/helm/kolla-common/templates/_common_delete_db_job.yaml index 2b9a72b19..86ddb3044 100644 --- a/helm/kolla-common/templates/_common_delete_db_job.yaml +++ b/helm/kolla-common/templates/_common_delete_db_job.yaml @@ -1,4 +1,5 @@ {{- define "common_delete_db_job" }} +{{- $imagePullPolicy := include "kolla_val_get_str" (dict "key" "image_pull_policy" "searchPath" .searchPath "Values" .Values ) }} {{- $containerConfigDirectory := include "kolla_val_get_str" (dict "key" "container_config_directory" "searchPath" .searchPath "Values" .Values ) }} {{- $selectorKey := include "kolla_val_get_str" (dict "key" "selector_key" "searchPath" .searchPath "Values" .Values ) }} {{- $selectorValue := include "kolla_val_get_str" (dict "key" "selector_value" "searchPath" .searchPath "Values" .Values ) }} @@ -22,6 +23,7 @@ spec: restartPolicy: OnFailure containers: - image: {{ include "kolla_toolbox_image_full" . | quote }} + imagePullPolicy: {{ $imagePullPolicy | quote }} name: "deleting-{{ .serviceName }}-database" command: ["sh", "-c"] args: @@ -45,6 +47,7 @@ spec: name: database-password key: password - image: {{ include "kolla_toolbox_image_full" . | quote }} + imagePullPolicy: {{ $imagePullPolicy | quote }} name: "deleting-{{ .serviceName }}-user" command: ["sh", "-c"] args: diff --git a/helm/kolla-common/templates/_common_delete_keystone_service.yaml b/helm/kolla-common/templates/_common_delete_keystone_service.yaml index 603068d7f..204271632 100644 --- a/helm/kolla-common/templates/_common_delete_keystone_service.yaml +++ b/helm/kolla-common/templates/_common_delete_keystone_service.yaml @@ -1,4 +1,5 @@ {{- define "common_delete_keystone_service" }} +{{- $imagePullPolicy := include "kolla_val_get_str" (dict "key" "image_pull_policy" "searchPath" .searchPath "Values" .Values ) }} {{- $region := include "kolla_val_get_str" (dict "key" "region" "searchPath" .searchPath "Values" .Values ) }} {{- $selectorKey := include "kolla_val_get_str" (dict "key" "selector_key" "searchPath" .searchPath "Values" .Values ) }} {{- $selectorValue := include "kolla_val_get_str" (dict "key" "selector_value" "searchPath" .searchPath "Values" .Values ) }} @@ -29,6 +30,7 @@ spec: {{ $selectorKey }}: {{ $selectorValue | quote }} containers: - image: {{ include "kolla_toolbox_image_full" . | quote }} + imagePullPolicy: {{ $imagePullPolicy | quote }} name: main command: ["sh", "-xec"] args: diff --git a/helm/kolla-common/templates/_common_delete_keystone_user.yaml b/helm/kolla-common/templates/_common_delete_keystone_user.yaml index b4afb35bf..8c90aa1ff 100644 --- a/helm/kolla-common/templates/_common_delete_keystone_user.yaml +++ b/helm/kolla-common/templates/_common_delete_keystone_user.yaml @@ -1,4 +1,5 @@ {{- define "common_delete_keystone_user" }} +{{- $imagePullPolicy := include "kolla_val_get_str" (dict "key" "image_pull_policy" "searchPath" .searchPath "Values" .Values ) }} {{- $region := include "kolla_val_get_str" (dict "key" "region" "searchPath" .searchPath "Values" .Values ) }} {{- $selectorKey := include "kolla_val_get_str" (dict "key" "selector_key" "searchPath" .searchPath "Values" .Values ) }} {{- $selectorValue := include "kolla_val_get_str" (dict "key" "selector_value" "searchPath" .searchPath "Values" .Values ) }} @@ -28,6 +29,7 @@ spec: {{ $selectorKey }}: {{ $selectorValue | quote }} containers: - image: {{ include "kolla_toolbox_image_full" . | quote }} + imagePullPolicy: {{ $imagePullPolicy | quote }} name: main command: ["sh", "-xec"] args: diff --git a/helm/kolla-common/templates/_common_lib.yaml b/helm/kolla-common/templates/_common_lib.yaml index 8b47f83a9..281d7cd30 100644 --- a/helm/kolla-common/templates/_common_lib.yaml +++ b/helm/kolla-common/templates/_common_lib.yaml @@ -25,9 +25,11 @@ {{- $_ := set $c1 "retKey" "kube_logger" }} {{- $_ := include "kolla_val_get_raw" $c1 }} {{- $containerConfigDirectory := include "kolla_val_get_str" (dict "key" "container_config_directory" "searchPath" .searchPath "Values" .Values ) }} +{{- $imagePullPolicy := include "kolla_val_get_str" (dict "key" "image_pull_policy" "searchPath" .searchPath "Values" .Values ) }} {{- if $localVals.kube_logger }} - name: logging image: {{ include "fluentd_image_full" . | quote }} + imagePullPolicy: {{ $imagePullPolicy | quote }} volumeMounts: - mountPath: {{ $containerConfigDirectory }} name: logging-config diff --git a/helm/kolla-common/templates/_common_manage_db_job.yaml b/helm/kolla-common/templates/_common_manage_db_job.yaml index 5d5a6d4ed..a3dcb2182 100644 --- a/helm/kolla-common/templates/_common_manage_db_job.yaml +++ b/helm/kolla-common/templates/_common_manage_db_job.yaml @@ -1,4 +1,5 @@ {{- define "common_manage_db_job" }} +{{- $imagePullPolicy := include "kolla_val_get_str" (dict "key" "image_pull_policy" "searchPath" .searchPath "Values" .Values ) }} {{- $containerConfigDirectory := include "kolla_val_get_str" (dict "key" "container_config_directory" "searchPath" .searchPath "Values" .Values ) }} {{- $selectorKey := include "kolla_val_get_str" (dict "key" "selector_key" "searchPath" .searchPath "Values" .Values ) }} {{- $selectorValue := include "kolla_val_get_str" (dict "key" "selector_value" "searchPath" .searchPath "Values" .Values ) }} @@ -17,6 +18,7 @@ spec: restartPolicy: OnFailure containers: - image: {{ .imageFull | quote }} + imagePullPolicy: {{ $imagePullPolicy | quote }} name: "main" volumeMounts: {{ include "common_volume_mounts" . | indent 12 }} diff --git a/helm/kolla-common/templates/_common_statefulset.yaml b/helm/kolla-common/templates/_common_statefulset.yaml index 1a1ff4d14..ef61addec 100644 --- a/helm/kolla-common/templates/_common_statefulset.yaml +++ b/helm/kolla-common/templates/_common_statefulset.yaml @@ -43,6 +43,7 @@ spec: containers: - name: main image: "{{ .imageFull }}" + imagePullPolicy: {{ $imagePullPolicy | quote }} volumeMounts: {{- include "common_volume_mounts" . | indent 12 }} - mountPath: {{ $containerConfigDirectory }} diff --git a/helm/microservice/ceph-admin-pod/templates/ceph-admin-pod.yaml b/helm/microservice/ceph-admin-pod/templates/ceph-admin-pod.yaml index 75d34c365..6a66d2f29 100644 --- a/helm/microservice/ceph-admin-pod/templates/ceph-admin-pod.yaml +++ b/helm/microservice/ceph-admin-pod/templates/ceph-admin-pod.yaml @@ -5,6 +5,7 @@ {{- $_ := set $c "imageName" "image_full" }} {{- $_ := set $c "tagName" "image_tag" }} {{- $imageFull := include "kolla_build_image_full" $c }} +{{- $imagePullPolicy := include "kolla_val_get_str" (dict "key" "image_pull_policy" "searchPath" $searchPath "Values" .Values ) }} {{- $selectorKey := include "kolla_val_get_str" (dict "key" "selector_key" "searchPath" $searchPath "Values" .Values ) }} {{- $selectorValue := include "kolla_val_get_str" (dict "key" "selector_value" "searchPath" $searchPath "Values" .Values ) }} {{- $netHostTrue := true }} @@ -22,6 +23,7 @@ spec: restartPolicy: Never containers: - image: "{{ $imageFull }}" + imagePullPolicy: {{ $imagePullPolicy | quote }} name: main command: - /bin/bash diff --git a/helm/microservice/ceph-rbd-daemonset/templates/ceph-rbd-daemonset.yaml b/helm/microservice/ceph-rbd-daemonset/templates/ceph-rbd-daemonset.yaml index 9629d85ad..cead33ef2 100644 --- a/helm/microservice/ceph-rbd-daemonset/templates/ceph-rbd-daemonset.yaml +++ b/helm/microservice/ceph-rbd-daemonset/templates/ceph-rbd-daemonset.yaml @@ -5,6 +5,7 @@ {{- $_ := set $c "imageName" "image_full" }} {{- $_ := set $c "tagName" "image_tag" }} {{- $imageFull := include "kolla_build_image_full" $c }} +{{- $imagePullPolicy := include "kolla_val_get_str" (dict "key" "image_pull_policy" "searchPath" $searchPath "Values" .Values ) }} {{- $selectorKey := include "kolla_val_get_str" (dict "key" "selector_key" "searchPath" $searchPath "Values" .Values ) }} {{- $selectorValue := include "kolla_val_get_str" (dict "key" "selector_value" "searchPath" $searchPath "Values" .Values ) }} {{- $netHostTrue := true }} @@ -30,6 +31,7 @@ spec: {{ $selectorKey }}: {{ $selectorValue | quote }} containers: - image: "{{ $imageFull }}" + imagePullPolicy: {{ $imagePullPolicy | quote }} name: main securityContext: privileged: true diff --git a/helm/microservice/cinder-backup-statefulset/templates/cinder-backup.yaml b/helm/microservice/cinder-backup-statefulset/templates/cinder-backup.yaml index 346dc3439..db092a067 100644 --- a/helm/microservice/cinder-backup-statefulset/templates/cinder-backup.yaml +++ b/helm/microservice/cinder-backup-statefulset/templates/cinder-backup.yaml @@ -72,6 +72,7 @@ spec: containers: - name: main image: "{{ $imageFull }}" + imagePullPolicy: {{ $imagePullPolicy | quote }} volumeMounts: {{- include "common_volume_mounts" $env | indent 12 }} - mountPath: /var/lib/kolla-kubernetes/event diff --git a/helm/microservice/cinder-volume-ceph-statefulset/templates/cinder-volume-ceph.yaml b/helm/microservice/cinder-volume-ceph-statefulset/templates/cinder-volume-ceph.yaml index 49bbd5993..1b444885d 100644 --- a/helm/microservice/cinder-volume-ceph-statefulset/templates/cinder-volume-ceph.yaml +++ b/helm/microservice/cinder-volume-ceph-statefulset/templates/cinder-volume-ceph.yaml @@ -88,6 +88,7 @@ spec: {{ $selectorKey }}: {{ $selectorValue | quote }} containers: - image: "{{ $imageFull }}" + imagePullPolicy: {{ $imagePullPolicy | quote }} name: main env: {{- include "common_env_vars" $env | indent 12 }} diff --git a/helm/microservice/cinder-volume-lvm-daemonset/templates/cinder-volume-lvm-daemonset.yaml b/helm/microservice/cinder-volume-lvm-daemonset/templates/cinder-volume-lvm-daemonset.yaml index 98b6e6a9f..4e9722805 100644 --- a/helm/microservice/cinder-volume-lvm-daemonset/templates/cinder-volume-lvm-daemonset.yaml +++ b/helm/microservice/cinder-volume-lvm-daemonset/templates/cinder-volume-lvm-daemonset.yaml @@ -94,6 +94,7 @@ spec: {{ $selectorKey }}: {{ $selectorValue | quote }} containers: - image: "{{ $imageFull }}" + imagePullPolicy: {{ $imagePullPolicy | quote }} name: main securityContext: privileged: true diff --git a/helm/microservice/glance-api-deployment/templates/glance-api.yaml b/helm/microservice/glance-api-deployment/templates/glance-api.yaml index 3e45a44bb..5c79c16a2 100644 --- a/helm/microservice/glance-api-deployment/templates/glance-api.yaml +++ b/helm/microservice/glance-api-deployment/templates/glance-api.yaml @@ -115,6 +115,7 @@ spec: {{- if $localVals.haproxy }} - name: haproxy image: {{ include "haproxy_image_full" . | quote }} + imagePullPolicy: {{ $imagePullPolicy | quote }} command: - /bin/bash - -c @@ -153,6 +154,7 @@ spec: {{- end }} - name: main image: "{{ $imageFull }}" + imagePullPolicy: {{ $imagePullPolicy | quote }} {{- if $localVals.haproxy }} lifecycle: preStop: diff --git a/helm/microservice/glance-manage-db-job/templates/glance-manage-db.yaml b/helm/microservice/glance-manage-db-job/templates/glance-manage-db.yaml index 94178ff1f..fe2579c30 100644 --- a/helm/microservice/glance-manage-db-job/templates/glance-manage-db.yaml +++ b/helm/microservice/glance-manage-db-job/templates/glance-manage-db.yaml @@ -33,6 +33,7 @@ spec: {{ $selectorKey }}: {{ $selectorValue | quote }} containers: - image: {{ $imageFull | quote }} + imagePullPolicy: {{ $imagePullPolicy | quote }} name: main env: {{- include "common_bootstrap_env_vars" $env | indent 12 }} diff --git a/helm/microservice/helm-repo-deployment/templates/helm-repo.yaml b/helm/microservice/helm-repo-deployment/templates/helm-repo.yaml index e77ef6446..cd8e9cf36 100644 --- a/helm/microservice/helm-repo-deployment/templates/helm-repo.yaml +++ b/helm/microservice/helm-repo-deployment/templates/helm-repo.yaml @@ -1,5 +1,4 @@ {{- $searchPath := ":global.kolla.helm-repo.deployment:global.kolla.helm-repo.all:global.kolla.all" }} -{{- $imagePullPolicy := include "kolla_val_get_str" (dict "key" "image_pull_policy" "searchPath" $searchPath "Values" .Values ) }} {{- $selectorKey := include "kolla_val_get_str" (dict "key" "selector_key" "searchPath" $searchPath "Values" .Values ) }} {{- $selectorValue := include "kolla_val_get_str" (dict "key" "selector_value" "searchPath" $searchPath "Values" .Values ) }} {{- $replicas := include "kolla_val_get_str" (dict "key" "replicas" "searchPath" $searchPath "Values" .Values ) }} @@ -100,6 +99,7 @@ spec: containers: - name: main image: "{{ $imageFull }}" + imagePullPolicy: {{ $imagePullPolicy | quote }} volumeMounts: {{- include "common_volume_mounts" $env | indent 12 }} {{- if $persistent }} diff --git a/helm/microservice/horizon-deployment/templates/horizon-api.yaml b/helm/microservice/horizon-deployment/templates/horizon-api.yaml index 700719b5e..69c80b373 100644 --- a/helm/microservice/horizon-deployment/templates/horizon-api.yaml +++ b/helm/microservice/horizon-deployment/templates/horizon-api.yaml @@ -37,6 +37,7 @@ spec: containers: - name: main image: "{{ $imageFull }}" + imagePullPolicy: {{ $imagePullPolicy | quote }} volumeMounts: {{- include "common_volume_mounts" $env | indent 10 }} - mountPath: {{ $containerConfigDirectory }} diff --git a/helm/microservice/iscsid-daemonset/templates/iscsid-daemonset.yaml b/helm/microservice/iscsid-daemonset/templates/iscsid-daemonset.yaml index d097028c7..55bfe8e54 100644 --- a/helm/microservice/iscsid-daemonset/templates/iscsid-daemonset.yaml +++ b/helm/microservice/iscsid-daemonset/templates/iscsid-daemonset.yaml @@ -56,6 +56,7 @@ spec: {{ $selectorKey }}: {{ $selectorValue | quote }} containers: - image: "{{ $imageFull }}" + imagePullPolicy: {{ $imagePullPolicy | quote }} name: main securityContext: privileged: true diff --git a/helm/microservice/keystone-create-endpoints-job/templates/keystone-create-endpoints.yaml b/helm/microservice/keystone-create-endpoints-job/templates/keystone-create-endpoints.yaml index 5b97cc4b7..c334fe3ec 100644 --- a/helm/microservice/keystone-create-endpoints-job/templates/keystone-create-endpoints.yaml +++ b/helm/microservice/keystone-create-endpoints-job/templates/keystone-create-endpoints.yaml @@ -16,6 +16,7 @@ {{- $_ := set $c "imageName" "image_full" }} {{- $_ := set $c "tagName" "image_tag" }} {{- $imageFull := include "kolla_build_image_full" $c }} +{{- $imagePullPolicy := include "kolla_val_get_str" (dict "key" "image_pull_policy" "searchPath" $searchPath "Values" .Values ) }} {{- $resourceName := "keystone" }} {{- $netHostTrue := false }} {{- $podTypeBootstrap := true }} @@ -41,6 +42,7 @@ spec: restartPolicy: OnFailure containers: - image: "{{ $imageFull }}" + imagePullPolicy: {{ $imagePullPolicy | quote }} name: main command: ["sh", "-c", "mkdir -p /var/log/kolla/keystone; sudo -E kolla_set_configs; kolla_keystone_bootstrap admin diff --git a/helm/microservice/mariadb-init-element-job/templates/mariadb-init-element.yaml b/helm/microservice/mariadb-init-element-job/templates/mariadb-init-element.yaml index 3054f1149..02e6afc94 100644 --- a/helm/microservice/mariadb-init-element-job/templates/mariadb-init-element.yaml +++ b/helm/microservice/mariadb-init-element-job/templates/mariadb-init-element.yaml @@ -7,6 +7,7 @@ {{- $_ := set $c "imageName" "image_full" }} {{- $_ := set $c "tagName" "image_tag" }} {{- $imageFull := include "kolla_build_image_full" $c }} +{{- $imagePullPolicy := include "kolla_val_get_str" (dict "key" "image_pull_policy" "searchPath" $searchPath "Values" .Values ) }} {{- $containerConfigDirectory := include "kolla_val_get_str" (dict "key" "container_config_directory" "searchPath" $searchPath "Values" .Values ) }} {{- $selectorKey := include "kolla_val_get_str" (dict "key" "selector_key" "searchPath" $searchPath "Values" .Values ) }} {{- $selectorValue := include "kolla_val_get_str" (dict "key" "selector_value" "searchPath" $searchPath "Values" .Values ) }} @@ -22,6 +23,7 @@ spec: {{ $selectorKey }}: {{ $selectorValue | quote }} containers: - image: "{{ $imageFull }}" + imagePullPolicy: {{ $imagePullPolicy | quote }} name: main volumeMounts: {{- include "common_volume_mounts" $env | indent 12 }} diff --git a/helm/microservice/mariadb-statefulset/templates/mariadb-pod.yaml b/helm/microservice/mariadb-statefulset/templates/mariadb-pod.yaml index 9e0f7a888..6e3683de9 100644 --- a/helm/microservice/mariadb-statefulset/templates/mariadb-pod.yaml +++ b/helm/microservice/mariadb-statefulset/templates/mariadb-pod.yaml @@ -7,6 +7,7 @@ {{- $_ := set $c "imageName" "image_full" }} {{- $_ := set $c "tagName" "image_tag" }} {{- $imageFull := include "kolla_build_image_full" $c }} +{{- $imagePullPolicy := include "kolla_val_get_str" (dict "key" "image_pull_policy" "searchPath" $searchPath "Values" .Values ) }} {{- $containerConfigDirectory := include "kolla_val_get_str" (dict "key" "container_config_directory" "searchPath" $searchPath "Values" .Values ) }} {{- $selectorKey := include "kolla_val_get_str" (dict "key" "selector_key" "searchPath" $searchPath "Values" .Values ) }} {{- $selectorValue := include "kolla_val_get_str" (dict "key" "selector_value" "searchPath" $searchPath "Values" .Values ) }} @@ -33,6 +34,7 @@ spec: {{ $selectorKey }}: {{ $selectorValue | quote }} containers: - image: "{{ $imageFull }}" + imagePullPolicy: {{ $imagePullPolicy | quote }} name: main lifecycle: preStop: diff --git a/helm/microservice/memcached-deployment/templates/memcached-deployment.yaml b/helm/microservice/memcached-deployment/templates/memcached-deployment.yaml index 003886b3d..dcb48c04b 100644 --- a/helm/microservice/memcached-deployment/templates/memcached-deployment.yaml +++ b/helm/microservice/memcached-deployment/templates/memcached-deployment.yaml @@ -19,6 +19,7 @@ {{- $selectorValue := include "kolla_val_get_str" (dict "key" "selector_value" "searchPath" $searchPath "Values" .Values ) }} {{- $port := include "kolla_val_get_str" (dict "key" "port" "searchPath" $searchPath "Values" .Values ) }} {{- $containerConfigDirectory := include "kolla_val_get_str" (dict "key" "container_config_directory" "searchPath" $searchPath "Values" .Values ) }} +{{- $imagePullPolicy := include "kolla_val_get_str" (dict "key" "image_pull_policy" "searchPath" $searchPath "Values" .Values ) }} {{- if $localVals.enabled }} apiVersion: extensions/v1beta1 kind: Deployment @@ -39,6 +40,7 @@ spec: {{ $selectorKey }}: {{ $selectorValue | quote }} containers: - image: "{{ $memcachedImageFull }}" + imagePullPolicy: {{ $imagePullPolicy | quote }} name: main volumeMounts: {{- include "common_volume_mounts" $env | indent 12 }} diff --git a/helm/microservice/neutron-l3-agent-daemonset/templates/l3-agent-daemonset.yaml b/helm/microservice/neutron-l3-agent-daemonset/templates/l3-agent-daemonset.yaml index 8ef75c4e6..5d4301f5d 100644 --- a/helm/microservice/neutron-l3-agent-daemonset/templates/l3-agent-daemonset.yaml +++ b/helm/microservice/neutron-l3-agent-daemonset/templates/l3-agent-daemonset.yaml @@ -109,6 +109,7 @@ spec: {{ $selectorKey }}: {{ $selectorValue | quote }} containers: - image: {{ $imageFull | quote }} + imagePullPolicy: {{ $imagePullPolicy | quote }} name: main securityContext: privileged: true diff --git a/helm/microservice/neutron-openvswitch-agent-daemonset/templates/openvswitch-agent-daemonset.yaml b/helm/microservice/neutron-openvswitch-agent-daemonset/templates/openvswitch-agent-daemonset.yaml index d24966702..1744a5818 100644 --- a/helm/microservice/neutron-openvswitch-agent-daemonset/templates/openvswitch-agent-daemonset.yaml +++ b/helm/microservice/neutron-openvswitch-agent-daemonset/templates/openvswitch-agent-daemonset.yaml @@ -118,6 +118,7 @@ spec: {{ $selectorKey }}: {{ $selectorValue | quote }} containers: - image: "{{ $imageFull }}" + imagePullPolicy: {{ $imagePullPolicy | quote }} name: main securityContext: privileged: true diff --git a/helm/microservice/nova-compute-daemonset/templates/nova-compute.yaml b/helm/microservice/nova-compute-daemonset/templates/nova-compute.yaml index 19428792b..108ee6b9c 100644 --- a/helm/microservice/nova-compute-daemonset/templates/nova-compute.yaml +++ b/helm/microservice/nova-compute-daemonset/templates/nova-compute.yaml @@ -133,6 +133,7 @@ spec: {{- end }} containers: - name: main + imagePullPolicy: {{ $imagePullPolicy | quote }} image: "{{ $imageFull }}" securityContext: privileged: true diff --git a/helm/microservice/nova-libvirt-daemonset/templates/nova-libvirt.yaml b/helm/microservice/nova-libvirt-daemonset/templates/nova-libvirt.yaml index d13fac7ec..725731a25 100644 --- a/helm/microservice/nova-libvirt-daemonset/templates/nova-libvirt.yaml +++ b/helm/microservice/nova-libvirt-daemonset/templates/nova-libvirt.yaml @@ -97,6 +97,7 @@ spec: containers: - name: main image: "{{ $imageFull }}" + imagePullPolicy: {{ $imagePullPolicy | quote }} command: - /bin/bash - -c diff --git a/helm/microservice/openvswitch-ovsdb-daemonset/templates/openvswitch-ovsdb-daemonset.yaml b/helm/microservice/openvswitch-ovsdb-daemonset/templates/openvswitch-ovsdb-daemonset.yaml index ed9286656..f3566fa81 100644 --- a/helm/microservice/openvswitch-ovsdb-daemonset/templates/openvswitch-ovsdb-daemonset.yaml +++ b/helm/microservice/openvswitch-ovsdb-daemonset/templates/openvswitch-ovsdb-daemonset.yaml @@ -59,6 +59,7 @@ spec: {{ $selectorKey }}: {{ $selectorValue | quote }} containers: - image: "{{ $imageFull }}" + imagePullPolicy: {{ $imagePullPolicy | quote }} name: main securityContext: privileged: true diff --git a/helm/microservice/openvswitch-vswitchd-daemonset/templates/openvswitch-vswitchd-daemonset.yaml b/helm/microservice/openvswitch-vswitchd-daemonset/templates/openvswitch-vswitchd-daemonset.yaml index 7cf592ec4..09ca9a885 100644 --- a/helm/microservice/openvswitch-vswitchd-daemonset/templates/openvswitch-vswitchd-daemonset.yaml +++ b/helm/microservice/openvswitch-vswitchd-daemonset/templates/openvswitch-vswitchd-daemonset.yaml @@ -99,6 +99,7 @@ spec: {{ $selectorKey }}: {{ $selectorValue | quote }} containers: - image: "{{ $imageFull }}" + imagePullPolicy: {{ $imagePullPolicy | quote }} name: main securityContext: privileged: true diff --git a/helm/microservice/rabbitmq-init-element-job/templates/rabbitmq-init-element.yaml b/helm/microservice/rabbitmq-init-element-job/templates/rabbitmq-init-element.yaml index 5a168e277..fe9c1314d 100644 --- a/helm/microservice/rabbitmq-init-element-job/templates/rabbitmq-init-element.yaml +++ b/helm/microservice/rabbitmq-init-element-job/templates/rabbitmq-init-element.yaml @@ -27,6 +27,7 @@ spec: {{ $selectorKey }}: {{ $selectorValue | quote }} containers: - image: "{{ $imageFull }}" + imagePullPolicy: {{ $imagePullPolicy | quote }} name: main volumeMounts: {{- include "common_volume_mounts" $env | indent 12 }} diff --git a/helm/microservice/rabbitmq-statefulset/templates/rabbitmq-pod.yaml b/helm/microservice/rabbitmq-statefulset/templates/rabbitmq-pod.yaml index 8034643a3..9fb347c6c 100644 --- a/helm/microservice/rabbitmq-statefulset/templates/rabbitmq-pod.yaml +++ b/helm/microservice/rabbitmq-statefulset/templates/rabbitmq-pod.yaml @@ -55,6 +55,7 @@ spec: {{ $selectorKey }}: {{ $selectorValue | quote }} containers: - image: "{{ $imageFull }}" + imagePullPolicy: {{ $imagePullPolicy | quote }} name: main volumeMounts: {{- include "common_volume_mounts" $env | indent 12 }} diff --git a/helm/microservice/tgtd-daemonset/templates/tgtd-daemonset.yaml b/helm/microservice/tgtd-daemonset/templates/tgtd-daemonset.yaml index bf25a6c40..757138291 100644 --- a/helm/microservice/tgtd-daemonset/templates/tgtd-daemonset.yaml +++ b/helm/microservice/tgtd-daemonset/templates/tgtd-daemonset.yaml @@ -62,6 +62,7 @@ spec: {{ $selectorKey }}: {{ $selectorValue | quote }} containers: - image: "{{ $imageFull }}" + imagePullPolicy: {{ $imagePullPolicy | quote }} name: main securityContext: privileged: true diff --git a/kolla_kubernetes/tests/test_helm_templates.py b/kolla_kubernetes/tests/test_helm_templates.py index 3a264736b..6dd1cf91a 100644 --- a/kolla_kubernetes/tests/test_helm_templates.py +++ b/kolla_kubernetes/tests/test_helm_templates.py @@ -24,6 +24,11 @@ def _isdir(path, entry): class TestK8sTemplatesTest(base.BaseTestCase): + def _validate_image_pull_policy(self, package, pod): + for container in pod['spec']['containers']: + if 'imagePullPolicy' not in container: + raise Exception("imagePullPolicy not in %s" % package) + def test_validate_templates(self): srcdir = os.environ['HELMDIR'] helmbin = os.environ['HELMBIN'] @@ -59,3 +64,10 @@ class TestK8sTemplatesTest(base.BaseTestCase): if e.args[0] not in m: raise json.loads(js) + pod = None + try: + pod = y['spec']['template'] + except Exception: + pass + if pod: + self._validate_image_pull_policy(package, pod) diff --git a/releasenotes/notes/image-pull-4fc22fd41caf5904.yaml b/releasenotes/notes/image-pull-4fc22fd41caf5904.yaml new file mode 100644 index 000000000..8dd226eb2 --- /dev/null +++ b/releasenotes/notes/image-pull-4fc22fd41caf5904.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Image pull policy can now be set for all containerns.