Fix cluster deployment when cluster_user_trust=False
At the moment, cluster deployment fails when cluster_user_trust=False. This patch fixes this by not existing the script when TRUST_ID is not defined which is a side-effect of this. Change-Id: Ibd9270c87bfa5d2f490e2e226e33ca56696d9e81 Story: 2006531 Task: 36587
This commit is contained in:
parent
df3d5a3150
commit
5e6305b8b3
|
@ -5,17 +5,14 @@ set +x
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
$ssh_cmd mkdir -p /etc/kubernetes/
|
$ssh_cmd mkdir -p /etc/kubernetes/
|
||||||
|
|
||||||
if [ -z "${TRUST_ID}" ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
KUBE_OS_CLOUD_CONFIG=/etc/kubernetes/cloud-config
|
|
||||||
$ssh_cmd cp /etc/pki/tls/certs/ca-bundle.crt /etc/kubernetes/ca-bundle.crt
|
$ssh_cmd cp /etc/pki/tls/certs/ca-bundle.crt /etc/kubernetes/ca-bundle.crt
|
||||||
|
|
||||||
# Generate a the configuration for Kubernetes services
|
if [ -n "${TRUST_ID}" ]; then
|
||||||
# to talk to OpenStack Neutron and Cinder
|
KUBE_OS_CLOUD_CONFIG=/etc/kubernetes/cloud-config
|
||||||
CLOUD_CONFIG=$(cat <<EOF
|
|
||||||
|
# Generate a the configuration for Kubernetes services
|
||||||
|
# to talk to OpenStack Neutron and Cinder
|
||||||
|
cat > ${KUBE_OS_CLOUD_CONFIG} <<EOF
|
||||||
[Global]
|
[Global]
|
||||||
auth-url=$AUTH_URL
|
auth-url=$AUTH_URL
|
||||||
user-id=$TRUSTEE_USER_ID
|
user-id=$TRUSTEE_USER_ID
|
||||||
|
@ -33,24 +30,20 @@ monitor-max-retries=3
|
||||||
[BlockStorage]
|
[BlockStorage]
|
||||||
bs-version=v2
|
bs-version=v2
|
||||||
EOF
|
EOF
|
||||||
)
|
|
||||||
|
|
||||||
cat > ${KUBE_OS_CLOUD_CONFIG} <<EOF
|
# Provide optional region parameter if it's set.
|
||||||
$CLOUD_CONFIG
|
if [ -n "${REGION_NAME}" ]; then
|
||||||
EOF
|
sed -i '/ca-file/a region='${REGION_NAME}'' $KUBE_OS_CLOUD_CONFIG
|
||||||
|
fi
|
||||||
|
|
||||||
# Provide optional region parameter if it's set.
|
# backwards compatibility, some apps may expect this file from previous magnum versions.
|
||||||
if [ -n "${REGION_NAME}" ]; then
|
$ssh_cmd cp ${KUBE_OS_CLOUD_CONFIG} /etc/kubernetes/kube_openstack_config
|
||||||
sed -i '/ca-file/a region='${REGION_NAME}'' $KUBE_OS_CLOUD_CONFIG
|
$ssh_cmd cp ${KUBE_OS_CLOUD_CONFIG} ${KUBE_OS_CLOUD_CONFIG}-occm
|
||||||
fi
|
|
||||||
|
|
||||||
# backwards compatibility, some apps may expect this file from previous magnum versions.
|
# Append additional networking config to config file provided to openstack
|
||||||
$ssh_cmd cp ${KUBE_OS_CLOUD_CONFIG} /etc/kubernetes/kube_openstack_config
|
# cloud controller manager (not supported by in-tree Cinder).
|
||||||
|
cat >> ${KUBE_OS_CLOUD_CONFIG}-occm <<EOF
|
||||||
# Append additional networking config to config file provided to openstack
|
|
||||||
# cloud controller manager (not supported by in-tree Cinder).
|
|
||||||
cat > ${KUBE_OS_CLOUD_CONFIG}-occm <<EOF
|
|
||||||
$CLOUD_CONFIG
|
|
||||||
[Networking]
|
[Networking]
|
||||||
internal-network-name=$CLUSTER_NETWORK_NAME
|
internal-network-name=$CLUSTER_NETWORK_NAME
|
||||||
EOF
|
EOF
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue