Moving credentials into secrets

This commit is contained in:
jupierce 2016-11-29 11:18:03 -05:00
parent c4727a081b
commit 2269d05536
3 changed files with 70 additions and 49 deletions

View file

@ -15,6 +15,17 @@
"template": "django-psql-persistent" "template": "django-psql-persistent"
}, },
"objects": [ "objects": [
{
"kind": "Secret",
"apiVersion": "v1",
"metadata": {
"name": "${NAME}"
},
"stringData" : {
"databaseUser" : "${DATABASE_USER}",
"databasePassword" : "${DATABASE_PASSWORD}"
}
},
{ {
"kind": "Service", "kind": "Service",
"apiVersion": "v1", "apiVersion": "v1",
@ -204,11 +215,21 @@
}, },
{ {
"name": "DATABASE_USER", "name": "DATABASE_USER",
"value": "${DATABASE_USER}" "valueFrom": {
"secretKeyRef" : {
"name" : "${NAME}",
"key" : "databaseUser"
}
}
}, },
{ {
"name": "DATABASE_PASSWORD", "name": "DATABASE_PASSWORD",
"value": "${DATABASE_PASSWORD}" "valueFrom": {
"secretKeyRef" : {
"name" : "${NAME}",
"key" : "databasePassword"
}
}
}, },
{ {
"name": "APP_CONFIG", "name": "APP_CONFIG",
@ -333,11 +354,21 @@
"env": [ "env": [
{ {
"name": "POSTGRESQL_USER", "name": "POSTGRESQL_USER",
"value": "${DATABASE_USER}" "valueFrom": {
"secretKeyRef" : {
"name" : "${NAME}",
"key" : "databaseUser"
}
}
}, },
{ {
"name": "POSTGRESQL_PASSWORD", "name": "POSTGRESQL_PASSWORD",
"value": "${DATABASE_PASSWORD}" "valueFrom": {
"secretKeyRef" : {
"name" : "${NAME}",
"key" : "databasePassword"
}
}
}, },
{ {
"name": "POSTGRESQL_DATABASE", "name": "POSTGRESQL_DATABASE",

View file

@ -15,6 +15,17 @@
"template": "django-psql-example" "template": "django-psql-example"
}, },
"objects": [ "objects": [
{
"kind": "Secret",
"apiVersion": "v1",
"metadata": {
"name": "${NAME}"
},
"stringData" : {
"databaseUser" : "${DATABASE_USER}",
"databasePassword" : "${DATABASE_PASSWORD}"
}
},
{ {
"kind": "Service", "kind": "Service",
"apiVersion": "v1", "apiVersion": "v1",
@ -204,11 +215,21 @@
}, },
{ {
"name": "DATABASE_USER", "name": "DATABASE_USER",
"value": "${DATABASE_USER}" "valueFrom": {
"secretKeyRef" : {
"name" : "${NAME}",
"key" : "databaseUser"
}
}
}, },
{ {
"name": "DATABASE_PASSWORD", "name": "DATABASE_PASSWORD",
"value": "${DATABASE_PASSWORD}" "valueFrom": {
"secretKeyRef" : {
"name" : "${NAME}",
"key" : "databasePassword"
}
}
}, },
{ {
"name": "APP_CONFIG", "name": "APP_CONFIG",
@ -314,11 +335,21 @@
"env": [ "env": [
{ {
"name": "POSTGRESQL_USER", "name": "POSTGRESQL_USER",
"value": "${DATABASE_USER}" "valueFrom": {
"secretKeyRef" : {
"name" : "${NAME}",
"key" : "databaseUser"
}
}
}, },
{ {
"name": "POSTGRESQL_PASSWORD", "name": "POSTGRESQL_PASSWORD",
"value": "${DATABASE_PASSWORD}" "valueFrom": {
"secretKeyRef" : {
"name" : "${NAME}",
"key" : "databasePassword"
}
}
}, },
{ {
"name": "POSTGRESQL_DATABASE", "name": "POSTGRESQL_DATABASE",

View file

@ -189,26 +189,6 @@
} }
}, },
"env": [ "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", "name": "APP_CONFIG",
"value": "${APP_CONFIG}" "value": "${APP_CONFIG}"
@ -282,27 +262,6 @@
"generate": "expression", "generate": "expression",
"from": "[a-zA-Z0-9]{40}" "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", "name": "APP_CONFIG",
"displayName": "Application Configuration File Path", "displayName": "Application Configuration File Path",