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 () {
CEPH_KEY=$1
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 () {
@ -43,8 +43,7 @@ metadata:
name: ${KUBE_SECRET_NAME}
type: Opaque
data:
${CEPH_KEYRING_NAME}: |
$( kube_ceph_keyring_gen ${CEPH_KEYRING} ${CEPH_KEYRING_TEMPLATE} )
${CEPH_KEYRING_NAME}: $( kube_ceph_keyring_gen ${CEPH_KEYRING} ${CEPH_KEYRING_TEMPLATE} )
EOF
} | kubectl create --namespace ${DEPLOYMENT_NAMESPACE} -f -
fi

View File

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

View File

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

View File

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