KubeAPI: Update secrets to be in conformance with k8s 1.8

Kubernetes 1.8 is stricter about the feilds in a secrets manifest,
this PS updates OpenStack-Helm to be compliant.

Change-Id: I9e19d07060d8517e0f4fd3056013191b1b4ba2da
This commit is contained in:
intlabs 2017-10-09 18:20:03 -05:00
parent ecdf097885
commit 61569d1b8b
4 changed files with 7 additions and 12 deletions

View File

@ -25,7 +25,7 @@ function ceph_gen_key () {
function kube_ceph_keyring_gen () { function kube_ceph_keyring_gen () {
CEPH_KEY=$1 CEPH_KEY=$1
CEPH_KEY_TEMPLATE=$2 CEPH_KEY_TEMPLATE=$2
sed "s|{{"{{"}} key {{"}}"}}|${CEPH_KEY}|" ${CEPH_TEMPLATES_DIR}/${CEPH_KEY_TEMPLATE} | base64 | tr -d '\n' sed "s|{{"{{"}} key {{"}}"}}|${CEPH_KEY}|" ${CEPH_TEMPLATES_DIR}/${CEPH_KEY_TEMPLATE} | base64 -w0 | tr -d '\n'
} }
function create_kube_key () { function create_kube_key () {
@ -43,8 +43,7 @@ metadata:
name: ${KUBE_SECRET_NAME} name: ${KUBE_SECRET_NAME}
type: Opaque type: Opaque
data: data:
${CEPH_KEYRING_NAME}: | ${CEPH_KEYRING_NAME}: $( kube_ceph_keyring_gen ${CEPH_KEYRING} ${CEPH_KEYRING_TEMPLATE} )
$( kube_ceph_keyring_gen ${CEPH_KEYRING} ${CEPH_KEYRING_TEMPLATE} )
EOF EOF
} | kubectl create --namespace ${DEPLOYMENT_NAMESPACE} -f - } | kubectl create --namespace ${DEPLOYMENT_NAMESPACE} -f -
fi fi

View File

@ -31,8 +31,7 @@ metadata:
name: "${PVC_CEPH_STORAGECLASS_USER_SECRET_NAME}" name: "${PVC_CEPH_STORAGECLASS_USER_SECRET_NAME}"
type: kubernetes.io/rbd type: kubernetes.io/rbd
data: data:
key: | key: $(echo ${CEPH_KEY})
$(echo ${CEPH_KEY})
EOF EOF
} | kubectl create --namespace ${kube_namespace} -f - } | kubectl create --namespace ${kube_namespace} -f -
} }

View File

@ -25,7 +25,7 @@ function ceph_gen_key () {
function kube_ceph_keyring_gen () { function kube_ceph_keyring_gen () {
CEPH_KEY=$1 CEPH_KEY=$1
CEPH_KEY_TEMPLATE=$2 CEPH_KEY_TEMPLATE=$2
sed "s|{{"{{"}} key {{"}}"}}|${CEPH_KEY}|" ${CEPH_TEMPLATES_DIR}/${CEPH_KEY_TEMPLATE} | base64 | tr -d '\n' sed "s|{{"{{"}} key {{"}}"}}|${CEPH_KEY}|" ${CEPH_TEMPLATES_DIR}/${CEPH_KEY_TEMPLATE} | base64 -w0 | tr -d '\n'
} }
CEPH_CLIENT_KEY=$(ceph_gen_key) CEPH_CLIENT_KEY=$(ceph_gen_key)
@ -46,8 +46,7 @@ metadata:
name: ${KUBE_SECRET_NAME} name: ${KUBE_SECRET_NAME}
type: Opaque type: Opaque
data: data:
${CEPH_KEYRING_NAME}: | ${CEPH_KEYRING_NAME}: $( kube_ceph_keyring_gen ${CEPH_KEYRING} ${CEPH_KEYRING_TEMPLATE} )
$( kube_ceph_keyring_gen ${CEPH_KEYRING} ${CEPH_KEYRING_TEMPLATE} )
EOF EOF
} | kubectl create --namespace ${DEPLOYMENT_NAMESPACE} -f - } | kubectl create --namespace ${DEPLOYMENT_NAMESPACE} -f -
fi fi
@ -69,8 +68,7 @@ metadata:
name: ${KUBE_SECRET_NAME} name: ${KUBE_SECRET_NAME}
type: kubernetes.io/rbd type: kubernetes.io/rbd
data: data:
key: | key: $( echo ${CEPH_KEYRING} | base64 | tr -d '\n' )
$( echo ${CEPH_KEYRING} | base64 | tr -d '\n' )
EOF EOF
} | kubectl create --namespace ${DEPLOYMENT_NAMESPACE} -f - } | kubectl create --namespace ${DEPLOYMENT_NAMESPACE} -f -
fi fi

View File

@ -22,5 +22,4 @@ metadata:
name: mariadb-secrets name: mariadb-secrets
type: Opaque type: Opaque
data: data:
admin_user.cnf: | admin_user.cnf: {{ tuple "secrets/_admin_user.cnf.tpl" . | include "helm-toolkit.utils.template" | b64enc }}
{{ tuple "secrets/_admin_user.cnf.tpl" . | include "helm-toolkit.utils.template" | b64enc | indent 4 }}