Skip to content

Commit

Permalink
feat(charts): database configuration optimization of passport and con…
Browse files Browse the repository at this point in the history
…troller
  • Loading branch information
duanhongyi committed Jul 26, 2021
1 parent 1aa6e99 commit 8ed2860
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 29 deletions.
14 changes: 7 additions & 7 deletions charts/controller/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,25 @@ env:
- name: DRYCC_DEPLOY_HOOK_SECRET_KEY
valueFrom:
secretKeyRef:
name: deploy-hook-key
key: secret-key
name: controller-creds
key: deploy-hook-secret-key
{{- end }}
- name: DRYCC_SECRET_KEY
valueFrom:
secretKeyRef:
name: django-secret-key
key: secret-key
name: controller-creds
key: django-secret-key
- name: DRYCC_BUILDER_KEY
valueFrom:
secretKeyRef:
name: builder-key-auth
key: builder-key
{{- if eq .Values.global.database_location "off-cluster" }}
{{- if (.Values.database_url) }}
- name: DRYCC_DATABASE_URL
valueFrom:
secretKeyRef:
name: database-creds
key: url
name: controller-creds
key: database_url
{{- else if eq .Values.global.database_location "on-cluster" }}
- name: DRYCC_DATABASE_USER
valueFrom:
Expand Down
14 changes: 14 additions & 0 deletions charts/controller/templates/controller-secret-creds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Secret
metadata:
name: controller-creds
labels:
heritage: drycc
annotations:
"helm.sh/hook": pre-install
data:
{{- if (.Values.database_url) }}
database-url: {{ .Values.database_url | b64enc }}
{{- end }}
django-secret-key: {{ randAscii 64 | b64enc }}
deploy-hook-secret-key: {{ randAscii 64 | b64enc }}

This file was deleted.

11 changes: 0 additions & 11 deletions charts/controller/templates/deploy-hook-secret.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions charts/controller/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ app_storage_class: ""
replicas: 1
# Set celery replicas
celery_replicas: 1
# Configuring this will no longer use the built-in database component
database_url: ""

# Any custom controller environment variables
# can be specified as key-value pairs under environment
Expand Down

0 comments on commit 8ed2860

Please sign in to comment.