Use a json config file for fpdc configmap

Signed-off-by: Clement Verna <cverna@tutanota.com>
This commit is contained in:
Clement Verna 2018-09-26 14:04:04 +02:00
parent 913ff566ec
commit cfb47826bb
2 changed files with 9 additions and 32 deletions

View file

@ -27,7 +27,7 @@ spec:
protocol: TCP protocol: TCP
volumesMounts: volumesMounts:
- name: config-volume - name: config-volume
mountPath: /opt/app-root/src/fpdc/settings/ mountPath: /opt/app-root/config/
readOnly: true readOnly: true
readinessProbe: readinessProbe:
timeoutSeconds: 1 timeoutSeconds: 1

View file

@ -6,38 +6,15 @@ metadata:
labels: labels:
app: fpdc app: fpdc
data: data:
prod.py: |- config.json: |-
# Django settings for fpdc project. {
from base import *
{% if env == 'staging' %} {% if env == 'staging' %}
SECRET_KEY = '{{ stg_fpdc_secret_key }}' "SECRET_KEY": "{{ stg_fpdc_secret_key }}",
"DB_PASSWORD": "{{ fpdc_stg_db_pass }}",
"DB_HOST": "{{ fpdc_stg_db_server }}"
{% else %} {% else %}
SECRET_KEY = '{{ fpdc_secret_key }}' "SECRET_KEY": "{{ fpdc_secret_key }}",
"DB_PASSWORD": "{{ fpdc_db_pass }}",
"DB_HOST": "{{ fpdc_db_server }}"
{% endif %} {% endif %}
DEBUG = False
ALLOWED_HOSTS = []
{% if env == 'staging' %}
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'fpdc',
'USER': 'fpdc',
'PASSWORD': '{{ fpdc_stg_db_pass }}',
'HOST': '{{ fpdc_stg_db_server }}',
'PORT': '',
}
} }
{% else %}
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'fpdc',
'USER': 'fpdc',
'PASSWORD': '{{ fpdc_db_pass }}',
'HOST': '{{ fpdc_db_server }}',
'PORT': '',
}
}
{% endif %}