k8s(minor): load secrets as env vars
This commit is contained in:
parent
6b0f0e8993
commit
b8656858ec
|
@ -32,6 +32,21 @@ spec:
|
|||
- ./manage.py
|
||||
args:
|
||||
- app_gw_web
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: {{ include "p2.fullname" . }}-config
|
||||
prefix: PASSBOOK_
|
||||
env:
|
||||
- name: P2_REDIS__PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ .Release.Name }}-redis"
|
||||
key: redis-password
|
||||
- name: P2_POSTGRESQL__PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ .Release.Name }}-postgresql"
|
||||
key: postgresql-password
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8000
|
||||
|
|
|
@ -31,6 +31,21 @@ spec:
|
|||
- ./manage.py
|
||||
args:
|
||||
- migrate
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: {{ include "p2.fullname" . }}-config
|
||||
prefix: PASSBOOK_
|
||||
env:
|
||||
- name: P2_REDIS__PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ .Release.Name }}-redis"
|
||||
key: redis-password
|
||||
- name: P2_POSTGRESQL__PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ .Release.Name }}-postgresql"
|
||||
key: postgresql-password
|
||||
volumeMounts:
|
||||
- mountPath: /etc/passbook
|
||||
name: config-volume
|
||||
|
@ -42,6 +57,21 @@ spec:
|
|||
- ./manage.py
|
||||
args:
|
||||
- web
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: {{ include "p2.fullname" . }}-config
|
||||
prefix: PASSBOOK_
|
||||
env:
|
||||
- name: P2_REDIS__PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ .Release.Name }}-redis"
|
||||
key: redis-password
|
||||
- name: P2_POSTGRESQL__PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ .Release.Name }}-postgresql"
|
||||
key: postgresql-password
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8000
|
||||
|
|
|
@ -32,6 +32,21 @@ spec:
|
|||
- ./manage.py
|
||||
args:
|
||||
- worker
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: {{ include "p2.fullname" . }}-config
|
||||
prefix: PASSBOOK_
|
||||
env:
|
||||
- name: P2_REDIS__PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ .Release.Name }}-redis"
|
||||
key: redis-password
|
||||
- name: P2_POSTGRESQL__PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ .Release.Name }}-postgresql"
|
||||
key: postgresql-password
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8000
|
||||
|
|
|
@ -12,6 +12,6 @@ import os
|
|||
from django.core.wsgi import get_wsgi_application
|
||||
from sentry_sdk.integrations.wsgi import SentryWsgiMiddleware
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'passbook.settings')
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'passbook.root.settings')
|
||||
|
||||
application = SentryWsgiMiddleware(get_wsgi_application())
|
||||
|
|
Reference in New Issue