Merge pull request #75 from jupierce/migrate-passwords-to-secrets
Moving credentials into secrets
This commit is contained in:
commit
81e1afb25e
3 changed files with 123 additions and 72 deletions
|
@ -15,6 +15,18 @@
|
|||
"template": "nodejs-mongo-persistent"
|
||||
},
|
||||
"objects": [
|
||||
{
|
||||
"kind": "Secret",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "${NAME}"
|
||||
},
|
||||
"stringData": {
|
||||
"databaseUser": "${DATABASE_USER}",
|
||||
"databasePassword": "${DATABASE_PASSWORD}",
|
||||
"databaseAdminPassword" : "${DATABASE_ADMIN_PASSWORD}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Service",
|
||||
"apiVersion": "v1",
|
||||
|
@ -186,11 +198,21 @@
|
|||
},
|
||||
{
|
||||
"name": "MONGODB_USER",
|
||||
"value": "${DATABASE_USER}"
|
||||
"valueFrom": {
|
||||
"secretKeyRef" : {
|
||||
"name" : "${NAME}",
|
||||
"key" : "databaseUser"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "MONGODB_PASSWORD",
|
||||
"value": "${DATABASE_PASSWORD}"
|
||||
"valueFrom": {
|
||||
"secretKeyRef" : {
|
||||
"name" : "${NAME}",
|
||||
"key" : "databasePassword"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "MONGODB_DATABASE",
|
||||
|
@ -198,7 +220,12 @@
|
|||
},
|
||||
{
|
||||
"name": "MONGODB_ADMIN_PASSWORD",
|
||||
"value": "${DATABASE_ADMIN_PASSWORD}"
|
||||
"valueFrom": {
|
||||
"secretKeyRef" : {
|
||||
"name" : "${NAME}",
|
||||
"key" : "databaseAdminPassword"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"readinessProbe": {
|
||||
|
@ -323,11 +350,21 @@
|
|||
"env": [
|
||||
{
|
||||
"name": "MONGODB_USER",
|
||||
"value": "${DATABASE_USER}"
|
||||
"valueFrom": {
|
||||
"secretKeyRef" : {
|
||||
"name" : "${NAME}",
|
||||
"key" : "databaseUser"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "MONGODB_PASSWORD",
|
||||
"value": "${DATABASE_PASSWORD}"
|
||||
"valueFrom": {
|
||||
"secretKeyRef" : {
|
||||
"name" : "${NAME}",
|
||||
"key" : "databasePassword"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "MONGODB_DATABASE",
|
||||
|
@ -335,14 +372,24 @@
|
|||
},
|
||||
{
|
||||
"name": "MONGODB_ADMIN_PASSWORD",
|
||||
"value": "${DATABASE_ADMIN_PASSWORD}"
|
||||
"valueFrom": {
|
||||
"secretKeyRef" : {
|
||||
"name" : "${NAME}",
|
||||
"key" : "databaseAdminPassword"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"readinessProbe": {
|
||||
"timeoutSeconds": 1,
|
||||
"initialDelaySeconds": 3,
|
||||
"exec": {
|
||||
"command": [ "/bin/sh", "-i", "-c", "mongo 127.0.0.1:27017/$MONGODB_DATABASE -u $MONGODB_USER -p $MONGODB_PASSWORD --eval=\"quit()\""]
|
||||
"command": [
|
||||
"/bin/sh",
|
||||
"-i",
|
||||
"-c",
|
||||
"mongo 127.0.0.1:27017/$MONGODB_DATABASE -u $MONGODB_USER -p $MONGODB_PASSWORD --eval=\"quit()\""
|
||||
]
|
||||
}
|
||||
},
|
||||
"livenessProbe": {
|
||||
|
|
|
@ -15,6 +15,18 @@
|
|||
"template": "nodejs-mongodb-example"
|
||||
},
|
||||
"objects": [
|
||||
{
|
||||
"kind": "Secret",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "${NAME}"
|
||||
},
|
||||
"stringData": {
|
||||
"databaseUser": "${DATABASE_USER}",
|
||||
"databasePassword": "${DATABASE_PASSWORD}",
|
||||
"databaseAdminPassword" : "${DATABASE_ADMIN_PASSWORD}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Service",
|
||||
"apiVersion": "v1",
|
||||
|
@ -186,11 +198,21 @@
|
|||
},
|
||||
{
|
||||
"name": "MONGODB_USER",
|
||||
"value": "${DATABASE_USER}"
|
||||
"valueFrom": {
|
||||
"secretKeyRef" : {
|
||||
"name" : "${NAME}",
|
||||
"key" : "databaseUser"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "MONGODB_PASSWORD",
|
||||
"value": "${DATABASE_PASSWORD}"
|
||||
"valueFrom": {
|
||||
"secretKeyRef" : {
|
||||
"name" : "${NAME}",
|
||||
"key" : "databasePassword"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "MONGODB_DATABASE",
|
||||
|
@ -198,7 +220,12 @@
|
|||
},
|
||||
{
|
||||
"name": "MONGODB_ADMIN_PASSWORD",
|
||||
"value": "${DATABASE_ADMIN_PASSWORD}"
|
||||
"valueFrom": {
|
||||
"secretKeyRef" : {
|
||||
"name" : "${NAME}",
|
||||
"key" : "databaseAdminPassword"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"readinessProbe": {
|
||||
|
@ -306,11 +333,21 @@
|
|||
"env": [
|
||||
{
|
||||
"name": "MONGODB_USER",
|
||||
"value": "${DATABASE_USER}"
|
||||
"valueFrom": {
|
||||
"secretKeyRef" : {
|
||||
"name" : "${NAME}",
|
||||
"key" : "databaseUser"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "MONGODB_PASSWORD",
|
||||
"value": "${DATABASE_PASSWORD}"
|
||||
"valueFrom": {
|
||||
"secretKeyRef" : {
|
||||
"name" : "${NAME}",
|
||||
"key" : "databasePassword"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "MONGODB_DATABASE",
|
||||
|
@ -318,14 +355,24 @@
|
|||
},
|
||||
{
|
||||
"name": "MONGODB_ADMIN_PASSWORD",
|
||||
"value": "${DATABASE_ADMIN_PASSWORD}"
|
||||
"valueFrom": {
|
||||
"secretKeyRef" : {
|
||||
"name" : "${NAME}",
|
||||
"key" : "databaseAdminPassword"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"readinessProbe": {
|
||||
"timeoutSeconds": 1,
|
||||
"initialDelaySeconds": 3,
|
||||
"exec": {
|
||||
"command": [ "/bin/sh", "-i", "-c", "mongo 127.0.0.1:27017/$MONGODB_DATABASE -u $MONGODB_USER -p $MONGODB_PASSWORD --eval=\"quit()\""]
|
||||
"command": [
|
||||
"/bin/sh",
|
||||
"-i",
|
||||
"-c",
|
||||
"mongo 127.0.0.1:27017/$MONGODB_DATABASE -u $MONGODB_USER -p $MONGODB_PASSWORD --eval=\"quit()\""
|
||||
]
|
||||
}
|
||||
},
|
||||
"livenessProbe": {
|
||||
|
|
|
@ -200,26 +200,6 @@
|
|||
}
|
||||
},
|
||||
"env": [
|
||||
{
|
||||
"name": "DATABASE_SERVICE_NAME",
|
||||
"value": "${DATABASE_SERVICE_NAME}"
|
||||
},
|
||||
{
|
||||
"name": "MONGODB_USER",
|
||||
"value": "${MONGODB_USER}"
|
||||
},
|
||||
{
|
||||
"name": "MONGODB_PASSWORD",
|
||||
"value": "${MONGODB_PASSWORD}"
|
||||
},
|
||||
{
|
||||
"name": "MONGODB_DATABASE",
|
||||
"value": "${MONGODB_DATABASE}"
|
||||
},
|
||||
{
|
||||
"name": "MONGODB_ADMIN_PASSWORD",
|
||||
"value": "${MONGODB_ADMIN_PASSWORD}"
|
||||
}
|
||||
],
|
||||
"resources": {
|
||||
"limits": {
|
||||
|
@ -292,29 +272,6 @@
|
|||
"generate": "expression",
|
||||
"from": "[a-zA-Z0-9]{40}"
|
||||
},
|
||||
{
|
||||
"name": "DATABASE_SERVICE_NAME",
|
||||
"displayName": "Database Service Name"
|
||||
},
|
||||
{
|
||||
"name": "MONGODB_USER",
|
||||
"displayName": "MongoDB Username",
|
||||
"description": "Username for MongoDB user that will be used for accessing the database."
|
||||
},
|
||||
{
|
||||
"name": "MONGODB_PASSWORD",
|
||||
"displayName": "MongoDB Password",
|
||||
"description": "Password for the MongoDB user."
|
||||
},
|
||||
{
|
||||
"name": "MONGODB_DATABASE",
|
||||
"displayName": "Database Name"
|
||||
},
|
||||
{
|
||||
"name": "MONGODB_ADMIN_PASSWORD",
|
||||
"displayName": "Database Administrator Password",
|
||||
"description": "Password for the database admin user."
|
||||
},
|
||||
{
|
||||
"name": "NPM_MIRROR",
|
||||
"displayName": "Custom NPM Mirror URL",
|
||||
|
|
Loading…
Reference in a new issue