Browse Source

Fix k8s_fedora to work with cinder volume driver

cinder volume driver of kubernetes requires hostname to be
same as instance name so that volume can be attached to
node running the pod, hostname-override is not required
by cinder volume driver.

hostname-override was introduced with following patch:
I55df72c8f36d81852bde36018c17670101860f79

In this patch following are fixed:
1) v3 --> v2(incorrect keystone version) is changed to v3 --> v2.0
2) --hostname-override is not added to KUBELET_ARGS for cinder
volume driver.

Change-Id: I1347b934d99ad6fe04e124e295c4961fe77c6b20
Closes-Bug: #1625479
Closes-Bug: #1620455
changes/17/373417/3
yatin 5 years ago
parent
commit
a7d719d08a
  1. 9
      magnum/drivers/common/templates/kubernetes/fragments/configure-kubernetes-minion.sh

9
magnum/drivers/common/templates/kubernetes/fragments/configure-kubernetes-minion.sh

@ -25,7 +25,8 @@ sed -i '
/^KUBE_MASTER=/ s|=.*|="--master='"$KUBE_MASTER_URI"'"|
' /etc/kubernetes/config
KUBELET_ARGS="--config=/etc/kubernetes/manifests --cadvisor-port=4194 --hostname-override=$KUBE_NODE_IP ${KUBE_CONFIG}"
HOSTNAME=$(hostname --short | sed 's/\.novalocal//')
KUBELET_ARGS="--config=/etc/kubernetes/manifests --cadvisor-port=4194 ${KUBE_CONFIG}"
if [ -n "${INSECURE_REGISTRY_URL}" ]; then
KUBELET_ARGS="${KUBELET_ARGS} --pod-infra-container-image=${INSECURE_REGISTRY_URL}/google_containers/pause\:0.8.0"
@ -36,7 +37,7 @@ sed -i '
/^KUBELET_ADDRESS=/ s/=.*/="--address=0.0.0.0"/
/^KUBELET_HOSTNAME=/ s/=.*/=""/
/^KUBELET_API_SERVER=/ s|=.*|="--api_servers='"$KUBE_MASTER_URI"'"|
/^KUBELET_ARGS=/ s|=.*|='"${KUBELET_ARGS}"'|
/^KUBELET_ARGS=/ s|=.*|="'"${KUBELET_ARGS}"' --hostname-override='"${KUBE_NODE_IP}"'"|
' /etc/kubernetes/kubelet
sed -i '
@ -63,7 +64,7 @@ if [ "$VOLUME_DRIVER" = "cinder" ]; then
if [ ! -d ${KUBERNETES} -o ! -f ${CLOUD_CONFIG} ]; then
sudo mkdir -p $KUBERNETES
fi
AUTH_URL=$(echo "$AUTH_URL" | sed 's/v3/v2/')
AUTH_URL=${AUTH_URL/v3/v2.0}
cat > $CLOUD_CONFIG <<EOF
[Global]
auth-url=$AUTH_URL
@ -74,7 +75,7 @@ tenant-name=$TENANT_NAME
EOF
cat << _EOC_ >> /etc/kubernetes/kubelet
#KUBELET_ARGS="$KUBELET_ARGS --cloud-provider=openstack --cloud-config=/etc/kubernetes/kube_openstack_config"
#KUBELET_ARGS="$KUBELET_ARGS --hostname-override=${HOSTNAME} --cloud-provider=openstack --cloud-config=/etc/kubernetes/kube_openstack_config"
_EOC_
if [ ! -f /usr/bin/udevadm ]; then

Loading…
Cancel
Save