Fix k8s deployment when cluster_user_trust=False
At the moment, cluster deployment fails when cluster_user_trust=False. This patch fixes this by not exiting the script when TRUST_ID is not defined which is a side-effect of this. Also do not set --cloud-provider=external when TRUST_ID is not defined in minion kubelet. Change-Id: Ibd9270c87bfa5d2f490e2e226e33ca56696d9e81 Story: 2006531 Task: 36587
This commit is contained in:
parent
df3d5a3150
commit
00e66e6b0b
|
@ -145,7 +145,7 @@ KUBELET_ARGS="${KUBELET_ARGS} --cluster_dns=${DNS_SERVICE_IP} --cluster_domain=$
|
|||
KUBELET_ARGS="${KUBELET_ARGS} --volume-plugin-dir=/var/lib/kubelet/volumeplugins"
|
||||
KUBELET_ARGS="${KUBELET_ARGS} ${KUBELET_OPTIONS}"
|
||||
|
||||
if [ "$(echo "${CLOUD_PROVIDER_ENABLED}" | tr '[:upper:]' '[:lower:]')" = "true" ]; then
|
||||
if [ -n "$TRUST_ID" ] && [ "$(echo "${CLOUD_PROVIDER_ENABLED}" | tr '[:upper:]' '[:lower:]')" = "true" ]; then
|
||||
KUBELET_ARGS="${KUBELET_ARGS} --cloud-provider=external"
|
||||
fi
|
||||
|
||||
|
|
|
@ -5,17 +5,14 @@ set +x
|
|||
set -x
|
||||
|
||||
$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
|
||||
|
||||
# Generate a the configuration for Kubernetes services
|
||||
# to talk to OpenStack Neutron and Cinder
|
||||
CLOUD_CONFIG=$(cat <<EOF
|
||||
if [ -n "${TRUST_ID}" ]; then
|
||||
KUBE_OS_CLOUD_CONFIG=/etc/kubernetes/cloud-config
|
||||
|
||||
# Generate a the configuration for Kubernetes services
|
||||
# to talk to OpenStack Neutron and Cinder
|
||||
cat > ${KUBE_OS_CLOUD_CONFIG} <<EOF
|
||||
[Global]
|
||||
auth-url=$AUTH_URL
|
||||
user-id=$TRUSTEE_USER_ID
|
||||
|
@ -33,24 +30,20 @@ monitor-max-retries=3
|
|||
[BlockStorage]
|
||||
bs-version=v2
|
||||
EOF
|
||||
)
|
||||
|
||||
cat > ${KUBE_OS_CLOUD_CONFIG} <<EOF
|
||||
$CLOUD_CONFIG
|
||||
EOF
|
||||
# Provide optional region parameter if it's set.
|
||||
if [ -n "${REGION_NAME}" ]; then
|
||||
sed -i '/ca-file/a region='${REGION_NAME}'' $KUBE_OS_CLOUD_CONFIG
|
||||
fi
|
||||
|
||||
# Provide optional region parameter if it's set.
|
||||
if [ -n "${REGION_NAME}" ]; then
|
||||
sed -i '/ca-file/a region='${REGION_NAME}'' $KUBE_OS_CLOUD_CONFIG
|
||||
fi
|
||||
# backwards compatibility, some apps may expect this file from previous magnum versions.
|
||||
$ssh_cmd cp ${KUBE_OS_CLOUD_CONFIG} /etc/kubernetes/kube_openstack_config
|
||||
$ssh_cmd cp ${KUBE_OS_CLOUD_CONFIG} ${KUBE_OS_CLOUD_CONFIG}-occm
|
||||
|
||||
# backwards compatibility, some apps may expect this file from previous magnum versions.
|
||||
$ssh_cmd cp ${KUBE_OS_CLOUD_CONFIG} /etc/kubernetes/kube_openstack_config
|
||||
|
||||
# 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
|
||||
# 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
|
||||
[Networking]
|
||||
internal-network-name=$CLUSTER_NETWORK_NAME
|
||||
EOF
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue