Skip to content

Commit

Permalink
fix: autoscaling and secrets (#1862)
Browse files Browse the repository at this point in the history
Signed-off-by: OMPRAKASH MISHRA <omprakashmishra3978@gmail.com>
  • Loading branch information
mishraomp authored Mar 6, 2024
1 parent f75f5fc commit 5a7c8ab
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
params:
--set backend.deploymentStrategy=RollingUpdate
--set frontend.deploymentStrategy=RollingUpdate

--set global.autoscaling=true
promote:
name: Promote Images
needs: [deploy-prod, vars]
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
7 changes: 7 additions & 0 deletions charts/app/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,10 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}


{{- define "secretLabels" -}}
{{ include "labels" . }}
{{- if .Values.global.secrets.persist }}
annotations:
"helm.sh/resource-policy": "keep"
{{- end }}
{{- end }}
4 changes: 2 additions & 2 deletions charts/app/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ apiVersion: v1
kind: Secret
metadata:
name: {{ .Release.Name }}
labels: {{- include "selectorLabels" . | nindent 4 }}
"helm.sh/resource-policy": keep
labels: {{- include "secretLabels" . | nindent 4 }}

data:
databasePassword: {{ $databasePassword | quote }}
postgres-password: {{ $databasePassword | quote }}
Expand Down
5 changes: 2 additions & 3 deletions charts/app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ global:
#-- the tag of the image, it can be latest, 1.0.0 etc..., or the sha256 hash
tag: ~
#-- turn off autoscaling for the entire suite by setting this to false. default is true.
autoscaling: true
autoscaling: false
#-- global secrets, can be accessed by sub-charts.
secrets:
enabled: true
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.
Expand Down

0 comments on commit 5a7c8ab

Please sign in to comment.