From 10d8b70fa7256d6a220a39e533756638285520cf Mon Sep 17 00:00:00 2001 From: Om Mishra <32200996+mishraomp@users.noreply.github.com> Date: Tue, 20 Feb 2024 12:04:47 -0800 Subject: [PATCH] feat: code changes to make deployment strategy derive from values and also update to 48.6 --- charts/nr-metabase/Chart.yaml | 4 ++-- .../charts/database/templates/deployment.yaml | 2 ++ charts/nr-metabase/templates/metabase/deployment.yaml | 2 ++ charts/nr-metabase/values.schema.json | 11 ++++++++++- charts/nr-metabase/values.yaml | 8 +++++++- 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/charts/nr-metabase/Chart.yaml b/charts/nr-metabase/Chart.yaml index c868e6e..a0c31aa 100644 --- a/charts/nr-metabase/Chart.yaml +++ b/charts/nr-metabase/Chart.yaml @@ -13,12 +13,12 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.48.5 +version: 0.48.6 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "v0.48.5" # aligned with metabase version. ALso update the global values appversion, there is no way to pass to +appVersion: "v0.48.6" # aligned with metabase version. ALso update the global values appversion, there is no way to pass to dependencies: - name: database condition: database.enabled diff --git a/charts/nr-metabase/charts/database/templates/deployment.yaml b/charts/nr-metabase/charts/database/templates/deployment.yaml index b818da7..e2b4346 100644 --- a/charts/nr-metabase/charts/database/templates/deployment.yaml +++ b/charts/nr-metabase/charts/database/templates/deployment.yaml @@ -5,6 +5,8 @@ metadata: labels: {{- include "database.labels" . | nindent 4 }} spec: + strategy: + type: {{ .Values.deploymentStrategy }} {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} {{- end }} diff --git a/charts/nr-metabase/templates/metabase/deployment.yaml b/charts/nr-metabase/templates/metabase/deployment.yaml index 36a3cc2..3f41caf 100644 --- a/charts/nr-metabase/templates/metabase/deployment.yaml +++ b/charts/nr-metabase/templates/metabase/deployment.yaml @@ -5,6 +5,8 @@ metadata: labels: {{- include "metabase.labels" . | nindent 4 }} spec: + strategy: + type: {{ .Values.metabase.deploymentStrategy }} {{- if not .Values.metabase.autoscaling.enabled }} replicas: {{ .Values.metabase.replicaCount }} {{- end }} diff --git a/charts/nr-metabase/values.schema.json b/charts/nr-metabase/values.schema.json index adbf016..98fd473 100644 --- a/charts/nr-metabase/values.schema.json +++ b/charts/nr-metabase/values.schema.json @@ -54,7 +54,9 @@ }, "metabase": { "type": "object", + "additionalProperties": true, "properties": { + "enabled": { "type": "boolean", "default": true @@ -64,6 +66,10 @@ "minimum": 0, "default": 1 }, + "deploymentStrategy":{ + "type": "string" + }, + "nameOverride": { "type": "string" }, @@ -172,8 +178,11 @@ }, "affinity": { "type": "object" - } + }, + "additionalItems": true + } + }, "database": { "type": "object", diff --git a/charts/nr-metabase/values.yaml b/charts/nr-metabase/values.yaml index 3ca63ec..773f3b2 100644 --- a/charts/nr-metabase/values.yaml +++ b/charts/nr-metabase/values.yaml @@ -17,11 +17,16 @@ metabase: replicaCount: 1 nameOverride: "" fullnameOverride: "" + deploymentStrategy: Recreate image: repository: ghcr.io/bcgov/nr-metabase/metabase pullPolicy: Always # this is for renovate give updated image alert. - tag: 0.48.5 + tag: 0.48.6 + # the below is for renovate to keep pushing PRs, so that it keeps getting updated. + metabaseImage: + repository: metabase/metabase + tag: v0.48.6 containerPort: 3000 environment: production service: @@ -49,6 +54,7 @@ database: replicaCount: 1 nameOverride: "" fullnameOverride: "" + deploymentStrategy: Recreate image: repository: ghcr.io/bcgov/nr-containers/postgres pullPolicy: Always