Skip to content

Commit

Permalink
Helm: fix secrets for non-default release name (#5403)
Browse files Browse the repository at this point in the history
  • Loading branch information
azhavoro authored Dec 1, 2022
1 parent 0943de9 commit 6f6db4d
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
cd helm-chart
helm dependency update
cd ..
helm upgrade -n default cvat -i --create-namespace helm-chart -f helm-chart/values.yaml -f tests/values.test.yaml
helm upgrade -n default release-${{ github.run_id }}-${{ github.run_attempt }} -i --create-namespace helm-chart -f helm-chart/values.yaml -f tests/values.test.yaml
- name: Update test config
run: |
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ non-ascii paths while adding files from "Connected file share" (issue #4428)
- Fixed FBRS serverless function runtime error on images with alpha channel (<https://github.com/opencv/cvat/pull/5384>)
- Attaching manifest with custom name (<https://github.com/opencv/cvat/pull/5377>)
- Uploading non-zip annotaion files (<https://github.com/opencv/cvat/pull/5386>)
- Broken helm chart - if using custom release name (<https://github.com/opencv/cvat/pull/5403>)
- Missing source tag in project annotations (<https://github.com/opencv/cvat/pull/5408>)

### Security
Expand Down
2 changes: 1 addition & 1 deletion helm-chart/templates/cvat-postgres-secret.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: Secret
metadata:
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
namespace: {{ .Release.Namespace }}
labels:
{{- include "cvat.labels" . | nindent 4 }}
Expand Down
2 changes: 1 addition & 1 deletion helm-chart/templates/cvat-server-secret.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: Secret
metadata:
name: "{{ .Release.Name }}-{{ .Values.cvat.backend.server.secret.name }}"
name: "{{ tpl ( .Values.cvat.backend.server.secret.name) . }}"
namespace: {{ .Release.Namespace }}
type: generic
stringData:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,22 @@ spec:
- name: CVAT_POSTGRES_HOST
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
key: postgresql-hostname
- name: CVAT_POSTGRES_USER
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
key: postgresql-username
- name: CVAT_POSTGRES_DBNAME
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
key: postgresql-database
- name: CVAT_POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
key: postgresql-password
{{- else }}
- name: CVAT_POSTGRES_HOST
Expand Down
16 changes: 8 additions & 8 deletions helm-chart/templates/cvat_backend/server/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,22 @@ spec:
- name: SOCIAL_AUTH_GOOGLE_CLIENT_ID
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-{{ .Values.cvat.backend.server.secret.name }}"
name: "{{ tpl (.Values.cvat.backend.server.secret.name) . }}"
key: googleClientId
- name: SOCIAL_AUTH_GOOGLE_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-{{ .Values.cvat.backend.server.secret.name }}"
name: "{{ tpl (.Values.cvat.backend.server.secret.name) . }}"
key: googleClientSecret
- name: SOCIAL_AUTH_GITHUB_CLIENT_ID
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-{{ .Values.cvat.backend.server.secret.name }}"
name: "{{ tpl (.Values.cvat.backend.server.secret.name) . }}"
key: githubClientId
- name: SOCIAL_AUTH_GITHUB_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-{{ .Values.cvat.backend.server.secret.name }}"
name: "{{ tpl (.Values.cvat.backend.server.secret.name) . }}"
key: googleClientSecret
{{- end }}
- name: IAM_OPA_BUNDLE
Expand All @@ -93,22 +93,22 @@ spec:
- name: CVAT_POSTGRES_HOST
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
key: postgresql-hostname
- name: CVAT_POSTGRES_USER
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
key: postgresql-username
- name: CVAT_POSTGRES_DBNAME
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
key: postgresql-database
- name: CVAT_POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
key: postgresql-password
{{- else }}
- name: CVAT_POSTGRES_HOST
Expand Down
8 changes: 4 additions & 4 deletions helm-chart/templates/cvat_backend/utils/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,22 @@ spec:
- name: CVAT_POSTGRES_HOST
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
key: postgresql-hostname
- name: CVAT_POSTGRES_USER
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
key: postgresql-username
- name: CVAT_POSTGRES_DBNAME
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
key: postgresql-database
- name: CVAT_POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
key: postgresql-password
{{- else }}
- name: CVAT_POSTGRES_HOST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,22 @@ spec:
- name: CVAT_POSTGRES_HOST
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
key: postgresql-hostname
- name: CVAT_POSTGRES_USER
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
key: postgresql-username
- name: CVAT_POSTGRES_DBNAME
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
key: postgresql-database
- name: CVAT_POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
key: postgresql-password
{{- else }}
- name: CVAT_POSTGRES_HOST
Expand Down
8 changes: 4 additions & 4 deletions helm-chart/templates/cvat_backend/worker_low/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,22 @@ spec:
- name: CVAT_POSTGRES_HOST
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
key: postgresql-hostname
- name: CVAT_POSTGRES_USER
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
key: postgresql-username
- name: CVAT_POSTGRES_DBNAME
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
key: postgresql-database
- name: CVAT_POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
key: postgresql-password
{{- else }}
- name: CVAT_POSTGRES_HOST
Expand Down
6 changes: 3 additions & 3 deletions helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ cvat:
USE_ALLAUTH_SOCIAL_ACCOUNTS: false
secret:
create: true
name: cvat-server-secret
name: "{{ .Release.Name }}-cvat-server-secret"
socialAccountAuthentication:
googleClientId: ""
googleClientSecret: ""
Expand Down Expand Up @@ -191,10 +191,10 @@ postgresql:
# If not external following config will be applied by default
global:
postgresql:
existingSecret: cvat-postgres-secret
existingSecret: "{{ .Release.Name }}-postgres-secret"
secret:
create: true
name: postgres-secret
name: "{{ .Release.Name }}-postgres-secret"
password: cvat_postgresql
postgres_password: cvat_postgresql_postgres
replication_password: cvat_postgresql_replica
Expand Down

0 comments on commit 6f6db4d

Please sign in to comment.