diff --git a/openshift/templates/django-postgresql-persistent.json b/openshift/templates/django-postgresql-persistent.json index 44e54d1..e3638f5 100644 --- a/openshift/templates/django-postgresql-persistent.json +++ b/openshift/templates/django-postgresql-persistent.json @@ -15,6 +15,17 @@ "template": "django-psql-persistent" }, "objects": [ + { + "kind": "Secret", + "apiVersion": "v1", + "metadata": { + "name": "${NAME}" + }, + "stringData" : { + "databaseUser" : "${DATABASE_USER}", + "databasePassword" : "${DATABASE_PASSWORD}" + } + }, { "kind": "Service", "apiVersion": "v1", @@ -204,11 +215,21 @@ }, { "name": "DATABASE_USER", - "value": "${DATABASE_USER}" + "valueFrom": { + "secretKeyRef" : { + "name" : "${NAME}", + "key" : "databaseUser" + } + } }, { "name": "DATABASE_PASSWORD", - "value": "${DATABASE_PASSWORD}" + "valueFrom": { + "secretKeyRef" : { + "name" : "${NAME}", + "key" : "databasePassword" + } + } }, { "name": "APP_CONFIG", @@ -333,11 +354,21 @@ "env": [ { "name": "POSTGRESQL_USER", - "value": "${DATABASE_USER}" + "valueFrom": { + "secretKeyRef" : { + "name" : "${NAME}", + "key" : "databaseUser" + } + } }, { "name": "POSTGRESQL_PASSWORD", - "value": "${DATABASE_PASSWORD}" + "valueFrom": { + "secretKeyRef" : { + "name" : "${NAME}", + "key" : "databasePassword" + } + } }, { "name": "POSTGRESQL_DATABASE", diff --git a/openshift/templates/django-postgresql.json b/openshift/templates/django-postgresql.json index 590d5fd..59ff8a9 100644 --- a/openshift/templates/django-postgresql.json +++ b/openshift/templates/django-postgresql.json @@ -15,6 +15,17 @@ "template": "django-psql-example" }, "objects": [ + { + "kind": "Secret", + "apiVersion": "v1", + "metadata": { + "name": "${NAME}" + }, + "stringData" : { + "databaseUser" : "${DATABASE_USER}", + "databasePassword" : "${DATABASE_PASSWORD}" + } + }, { "kind": "Service", "apiVersion": "v1", @@ -204,11 +215,21 @@ }, { "name": "DATABASE_USER", - "value": "${DATABASE_USER}" + "valueFrom": { + "secretKeyRef" : { + "name" : "${NAME}", + "key" : "databaseUser" + } + } }, { "name": "DATABASE_PASSWORD", - "value": "${DATABASE_PASSWORD}" + "valueFrom": { + "secretKeyRef" : { + "name" : "${NAME}", + "key" : "databasePassword" + } + } }, { "name": "APP_CONFIG", @@ -314,11 +335,21 @@ "env": [ { "name": "POSTGRESQL_USER", - "value": "${DATABASE_USER}" + "valueFrom": { + "secretKeyRef" : { + "name" : "${NAME}", + "key" : "databaseUser" + } + } }, { "name": "POSTGRESQL_PASSWORD", - "value": "${DATABASE_PASSWORD}" + "valueFrom": { + "secretKeyRef" : { + "name" : "${NAME}", + "key" : "databasePassword" + } + } }, { "name": "POSTGRESQL_DATABASE", diff --git a/openshift/templates/django.json b/openshift/templates/django.json index 7cbcb90..d4a5464 100644 --- a/openshift/templates/django.json +++ b/openshift/templates/django.json @@ -189,26 +189,6 @@ } }, "env": [ - { - "name": "DATABASE_SERVICE_NAME", - "value": "${DATABASE_SERVICE_NAME}" - }, - { - "name": "DATABASE_ENGINE", - "value": "${DATABASE_ENGINE}" - }, - { - "name": "DATABASE_NAME", - "value": "${DATABASE_NAME}" - }, - { - "name": "DATABASE_USER", - "value": "${DATABASE_USER}" - }, - { - "name": "DATABASE_PASSWORD", - "value": "${DATABASE_PASSWORD}" - }, { "name": "APP_CONFIG", "value": "${APP_CONFIG}" @@ -282,27 +262,6 @@ "generate": "expression", "from": "[a-zA-Z0-9]{40}" }, - { - "name": "DATABASE_SERVICE_NAME", - "displayName": "Database Service Name" - }, - { - "name": "DATABASE_ENGINE", - "displayName": "Database Engine", - "description": "Database engine: postgresql, mysql or sqlite (default)." - }, - { - "name": "DATABASE_NAME", - "displayName": "Database Name" - }, - { - "name": "DATABASE_USER", - "displayName": "Database Username" - }, - { - "name": "DATABASE_PASSWORD", - "displayName": "Database User Password" - }, { "name": "APP_CONFIG", "displayName": "Application Configuration File Path",