From 56c5b50b201c490f462757ee69070905b9f5cd24 Mon Sep 17 00:00:00 2001 From: OMPRAKASH MISHRA Date: Wed, 6 Mar 2024 13:04:14 -0800 Subject: [PATCH] fix: autoscaling and secrets Signed-off-by: OMPRAKASH MISHRA --- .github/workflows/merge.yml | 2 +- .github/workflows/pr-open.yml | 3 ++- charts/app/templates/secret.yaml | 5 ++++- charts/app/values.yaml | 3 +-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index ca9bb1985..415850f36 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -56,7 +56,7 @@ jobs: params: --set backend.deploymentStrategy=RollingUpdate --set frontend.deploymentStrategy=RollingUpdate - + --set global.autoscaling=true promote: name: Promote Images needs: [deploy-prod, vars] diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index b399286c1..291ea02b8 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -41,7 +41,8 @@ jobs: oc_token: ${{ secrets.OC_TOKEN }} with: triggers: ('backend/', 'frontend/', 'migrations/') - + params: + --set global.secrets.persist=false tests: name: Tests needs: [deploys] diff --git a/charts/app/templates/secret.yaml b/charts/app/templates/secret.yaml index 375880871..cf42319d6 100644 --- a/charts/app/templates/secret.yaml +++ b/charts/app/templates/secret.yaml @@ -16,8 +16,11 @@ apiVersion: v1 kind: Secret metadata: name: {{ .Release.Name }} - labels: {{- include "selectorLabels" . | nindent 4 }} + labels: {{- include "labels" . | nindent 4 }} + {{-if .Values.global.secrets.persist }} "helm.sh/resource-policy": keep + {{- end }} + data: databasePassword: {{ $databasePassword | quote }} postgres-password: {{ $databasePassword | quote }} diff --git a/charts/app/values.yaml b/charts/app/values.yaml index db8c07d96..ff5508028 100644 --- a/charts/app/values.yaml +++ b/charts/app/values.yaml @@ -16,8 +16,7 @@ global: databasePassword: ~ databaseUser: ~ databaseName: ~ - annotation: - helm.sh/policy: "keep" + persist: true #-- domain of the application, it is required, apps.silver.devops.gov.bc.ca for silver cluster and apps.devops.gov.bc.ca for gold cluster domain: "apps.silver.devops.gov.bc.ca" # it is apps.gold.devops.gov.bc.ca for gold cluster #-- the database Alias gives a nice way to switch to different databases, crunchy, patroni ... etc.