Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: autoscaling and secrets #1862

Merged
merged 5 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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