From 24fb19b7e4bbec46880987023efff2cd4755f350 Mon Sep 17 00:00:00 2001 From: Diana Barsan Date: Thu, 31 Oct 2024 15:59:14 +0200 Subject: [PATCH 1/4] set imagePullPolicy: Always --- charts/cht-chart-4x/templates/api-deployment.yaml | 1 + charts/cht-chart-4x/templates/couchdb-n-deployment.yaml | 1 + charts/cht-chart-4x/templates/couchdb-single-deployment.yaml | 1 + charts/cht-chart-4x/templates/haproxy-deployment.yaml | 3 ++- charts/cht-chart-4x/templates/healthcheck-deployment.yaml | 1 + charts/cht-chart-4x/templates/sentinel-deployment.yaml | 1 + charts/cht-chart-4x/templates/upgrade-service-deployment.yml | 1 + 7 files changed, 8 insertions(+), 1 deletion(-) diff --git a/charts/cht-chart-4x/templates/api-deployment.yaml b/charts/cht-chart-4x/templates/api-deployment.yaml index 8e3d6b1..6ecfbed 100644 --- a/charts/cht-chart-4x/templates/api-deployment.yaml +++ b/charts/cht-chart-4x/templates/api-deployment.yaml @@ -33,6 +33,7 @@ spec: - name: API_PORT value: '5988' image: {{ .Values.upstream_servers.docker_registry }}/cht-api:{{ .Values.cht_image_tag }} + imagePullPolicy: Always name: cht-api ports: - containerPort: 5988 diff --git a/charts/cht-chart-4x/templates/couchdb-n-deployment.yaml b/charts/cht-chart-4x/templates/couchdb-n-deployment.yaml index 5e1c9d2..77da522 100644 --- a/charts/cht-chart-4x/templates/couchdb-n-deployment.yaml +++ b/charts/cht-chart-4x/templates/couchdb-n-deployment.yaml @@ -37,6 +37,7 @@ spec: containers: - name: cht-couchdb-{{ $nodeNumber }} image: {{ $root.Values.upstream_servers.docker_registry }}/cht-couchdb:{{ $root.Values.cht_image_tag }} + imagePullPolicy: Always ports: - containerPort: 5984 env: diff --git a/charts/cht-chart-4x/templates/couchdb-single-deployment.yaml b/charts/cht-chart-4x/templates/couchdb-single-deployment.yaml index 745787c..ab4eb6d 100644 --- a/charts/cht-chart-4x/templates/couchdb-single-deployment.yaml +++ b/charts/cht-chart-4x/templates/couchdb-single-deployment.yaml @@ -58,6 +58,7 @@ spec: - name: SVC_NAME value: couchdb.{{ .Values.namespace }}.svc.cluster.local image: {{ .Values.upstream_servers.docker_registry }}/cht-couchdb:{{ .Values.cht_image_tag }} + imagePullPolicy: Always name: cht-couchdb ports: - containerPort: 5984 diff --git a/charts/cht-chart-4x/templates/haproxy-deployment.yaml b/charts/cht-chart-4x/templates/haproxy-deployment.yaml index f344384..b77b82c 100644 --- a/charts/cht-chart-4x/templates/haproxy-deployment.yaml +++ b/charts/cht-chart-4x/templates/haproxy-deployment.yaml @@ -38,7 +38,8 @@ spec: value: "5984" - name: HEALTHCHECK_ADDR value: healthcheck.{{ .Values.namespace }}.svc.cluster.local - image: {{ .Values.upstream_servers.docker_registry }}/cht-haproxy:{{ .Values.cht_image_tag }} + image: {{ .Values.upstream_servers.docker_registry }}/cht-haproxy:{{ .Values.cht_image_tag }}\ + imagePullPolicy: Always name: cht-haproxy ports: - containerPort: 5984 diff --git a/charts/cht-chart-4x/templates/healthcheck-deployment.yaml b/charts/cht-chart-4x/templates/healthcheck-deployment.yaml index 8519ba5..f7bcac9 100644 --- a/charts/cht-chart-4x/templates/healthcheck-deployment.yaml +++ b/charts/cht-chart-4x/templates/healthcheck-deployment.yaml @@ -33,6 +33,7 @@ spec: name: cht-couchdb-credentials key: COUCHDB_USER image: {{ .Values.upstream_servers.docker_registry }}/cht-haproxy-healthcheck:{{ .Values.cht_image_tag }} + imagePullPolicy: Always name: cht-haproxy-healthcheck resources: {} ports: diff --git a/charts/cht-chart-4x/templates/sentinel-deployment.yaml b/charts/cht-chart-4x/templates/sentinel-deployment.yaml index 28e8bab..9d21800 100644 --- a/charts/cht-chart-4x/templates/sentinel-deployment.yaml +++ b/charts/cht-chart-4x/templates/sentinel-deployment.yaml @@ -27,6 +27,7 @@ spec: - name: API_PORT value: '5988' image: {{ .Values.upstream_servers.docker_registry }}/cht-sentinel:{{ .Values.cht_image_tag }} + imagePullPolicy: Always name: cht-sentinel resources: {} restartPolicy: Always diff --git a/charts/cht-chart-4x/templates/upgrade-service-deployment.yml b/charts/cht-chart-4x/templates/upgrade-service-deployment.yml index a8e22cf..16fd392 100644 --- a/charts/cht-chart-4x/templates/upgrade-service-deployment.yml +++ b/charts/cht-chart-4x/templates/upgrade-service-deployment.yml @@ -23,6 +23,7 @@ spec: serviceAccountName: cht-upgrade-service-user containers: - image: medicmobile/upgrade-service:{{ .Values.upgrade_service.tag }} + imagePullPolicy: Always name: upgrade-service resources: {} env: From c96fc6d663ea17ab88ed53b7bb11335e7f86b941 Mon Sep 17 00:00:00 2001 From: Diana Barsan <35681649+dianabarsan@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:30:58 +0200 Subject: [PATCH 2/4] Code review feedback --- charts/cht-chart-4x/templates/haproxy-deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/cht-chart-4x/templates/haproxy-deployment.yaml b/charts/cht-chart-4x/templates/haproxy-deployment.yaml index b77b82c..ff3027f 100644 --- a/charts/cht-chart-4x/templates/haproxy-deployment.yaml +++ b/charts/cht-chart-4x/templates/haproxy-deployment.yaml @@ -38,7 +38,7 @@ spec: value: "5984" - name: HEALTHCHECK_ADDR value: healthcheck.{{ .Values.namespace }}.svc.cluster.local - image: {{ .Values.upstream_servers.docker_registry }}/cht-haproxy:{{ .Values.cht_image_tag }}\ + image: {{ .Values.upstream_servers.docker_registry }}/cht-haproxy:{{ .Values.cht_image_tag }} imagePullPolicy: Always name: cht-haproxy ports: From 5e4c6ea8924adaaa904c0e8f7c671a756747197f Mon Sep 17 00:00:00 2001 From: Diana Barsan Date: Fri, 1 Nov 2024 17:12:02 +0200 Subject: [PATCH 3/4] adds values variable --- charts/cht-chart-4x/templates/api-deployment.yaml | 2 +- charts/cht-chart-4x/templates/couchdb-n-deployment.yaml | 2 +- charts/cht-chart-4x/templates/couchdb-single-deployment.yaml | 2 +- charts/cht-chart-4x/templates/haproxy-deployment.yaml | 2 +- charts/cht-chart-4x/templates/healthcheck-deployment.yaml | 2 +- charts/cht-chart-4x/templates/sentinel-deployment.yaml | 2 +- charts/cht-chart-4x/templates/upgrade-service-deployment.yml | 2 +- charts/cht-chart-4x/values.yaml | 5 +++++ 8 files changed, 12 insertions(+), 7 deletions(-) diff --git a/charts/cht-chart-4x/templates/api-deployment.yaml b/charts/cht-chart-4x/templates/api-deployment.yaml index 6ecfbed..f5e749a 100644 --- a/charts/cht-chart-4x/templates/api-deployment.yaml +++ b/charts/cht-chart-4x/templates/api-deployment.yaml @@ -33,7 +33,7 @@ spec: - name: API_PORT value: '5988' image: {{ .Values.upstream_servers.docker_registry }}/cht-api:{{ .Values.cht_image_tag }} - imagePullPolicy: Always + {{ if eq .Values.cache_images false}}imagePullPolicy: Always{{ end }} name: cht-api ports: - containerPort: 5988 diff --git a/charts/cht-chart-4x/templates/couchdb-n-deployment.yaml b/charts/cht-chart-4x/templates/couchdb-n-deployment.yaml index 77da522..6d0d21a 100644 --- a/charts/cht-chart-4x/templates/couchdb-n-deployment.yaml +++ b/charts/cht-chart-4x/templates/couchdb-n-deployment.yaml @@ -37,7 +37,7 @@ spec: containers: - name: cht-couchdb-{{ $nodeNumber }} image: {{ $root.Values.upstream_servers.docker_registry }}/cht-couchdb:{{ $root.Values.cht_image_tag }} - imagePullPolicy: Always + {{ if eq $root.Values.cache_images false}}imagePullPolicy: Always{{ end }} ports: - containerPort: 5984 env: diff --git a/charts/cht-chart-4x/templates/couchdb-single-deployment.yaml b/charts/cht-chart-4x/templates/couchdb-single-deployment.yaml index ab4eb6d..c270a6f 100644 --- a/charts/cht-chart-4x/templates/couchdb-single-deployment.yaml +++ b/charts/cht-chart-4x/templates/couchdb-single-deployment.yaml @@ -58,7 +58,7 @@ spec: - name: SVC_NAME value: couchdb.{{ .Values.namespace }}.svc.cluster.local image: {{ .Values.upstream_servers.docker_registry }}/cht-couchdb:{{ .Values.cht_image_tag }} - imagePullPolicy: Always + {{ if eq .Values.cache_images false}}imagePullPolicy: Always{{ end }} name: cht-couchdb ports: - containerPort: 5984 diff --git a/charts/cht-chart-4x/templates/haproxy-deployment.yaml b/charts/cht-chart-4x/templates/haproxy-deployment.yaml index b77b82c..8acb9fe 100644 --- a/charts/cht-chart-4x/templates/haproxy-deployment.yaml +++ b/charts/cht-chart-4x/templates/haproxy-deployment.yaml @@ -39,7 +39,7 @@ spec: - name: HEALTHCHECK_ADDR value: healthcheck.{{ .Values.namespace }}.svc.cluster.local image: {{ .Values.upstream_servers.docker_registry }}/cht-haproxy:{{ .Values.cht_image_tag }}\ - imagePullPolicy: Always + {{ if eq .Values.cache_images false}}imagePullPolicy: Always{{ end }} name: cht-haproxy ports: - containerPort: 5984 diff --git a/charts/cht-chart-4x/templates/healthcheck-deployment.yaml b/charts/cht-chart-4x/templates/healthcheck-deployment.yaml index f7bcac9..4c2c8ba 100644 --- a/charts/cht-chart-4x/templates/healthcheck-deployment.yaml +++ b/charts/cht-chart-4x/templates/healthcheck-deployment.yaml @@ -33,7 +33,7 @@ spec: name: cht-couchdb-credentials key: COUCHDB_USER image: {{ .Values.upstream_servers.docker_registry }}/cht-haproxy-healthcheck:{{ .Values.cht_image_tag }} - imagePullPolicy: Always + {{ if eq .Values.cache_images false}}imagePullPolicy: Always{{ end }} name: cht-haproxy-healthcheck resources: {} ports: diff --git a/charts/cht-chart-4x/templates/sentinel-deployment.yaml b/charts/cht-chart-4x/templates/sentinel-deployment.yaml index 9d21800..02a0835 100644 --- a/charts/cht-chart-4x/templates/sentinel-deployment.yaml +++ b/charts/cht-chart-4x/templates/sentinel-deployment.yaml @@ -27,7 +27,7 @@ spec: - name: API_PORT value: '5988' image: {{ .Values.upstream_servers.docker_registry }}/cht-sentinel:{{ .Values.cht_image_tag }} - imagePullPolicy: Always + {{ if eq .Values.cache_images false}}imagePullPolicy: Always{{ end }} name: cht-sentinel resources: {} restartPolicy: Always diff --git a/charts/cht-chart-4x/templates/upgrade-service-deployment.yml b/charts/cht-chart-4x/templates/upgrade-service-deployment.yml index 16fd392..81bde39 100644 --- a/charts/cht-chart-4x/templates/upgrade-service-deployment.yml +++ b/charts/cht-chart-4x/templates/upgrade-service-deployment.yml @@ -23,7 +23,7 @@ spec: serviceAccountName: cht-upgrade-service-user containers: - image: medicmobile/upgrade-service:{{ .Values.upgrade_service.tag }} - imagePullPolicy: Always + {{ if eq .Values.cache_images false}}imagePullPolicy: Always{{ end }} name: upgrade-service resources: {} env: diff --git a/charts/cht-chart-4x/values.yaml b/charts/cht-chart-4x/values.yaml index 5d16d9f..ceb1fb5 100644 --- a/charts/cht-chart-4x/values.yaml +++ b/charts/cht-chart-4x/values.yaml @@ -3,6 +3,11 @@ namespace: "" # e.g. "cht-dev-namespace" chtversion: 4.10.0 # cht_image_tag: 4.1.1-4.1.1 #- This is filled in automatically by the deploy script. Don't uncomment this line. +# If images are cached, the same image tag will never be pulled twice. For development, this means that it's not +# possible to upgrade to a newer version of the same branch, as the old image will always be reused. +# For development instances, set this value to false. +cache_images: true + # Don't change upstream-servers unless you know what you're doing. upstream_servers: docker_registry: "public.ecr.aws/medic" From 182026aff3f2074c3aad890354ce6c399951d9e5 Mon Sep 17 00:00:00 2001 From: Diana Barsan <35681649+dianabarsan@users.noreply.github.com> Date: Mon, 4 Nov 2024 09:35:15 +0200 Subject: [PATCH 4/4] Bumps chart version. --- charts/cht-chart-4x/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/cht-chart-4x/Chart.yaml b/charts/cht-chart-4x/Chart.yaml index 69c7c4e..91791d4 100644 --- a/charts/cht-chart-4x/Chart.yaml +++ b/charts/cht-chart-4x/Chart.yaml @@ -6,6 +6,6 @@ icon: https://avatars.githubusercontent.com/u/474424?s=200&v=4 type: application -version: 1.1.1 +version: 1.2.0 appVersion: ""