Browse Source

Merge "k8s_fedora: Label master nodes with kubectl" into stable/rocky

tags/7.2.0
Zuul 2 months ago
parent
commit
254a9c8c1e
2 changed files with 9 additions and 2 deletions
  1. +0
    -1
      magnum/drivers/common/templates/kubernetes/fragments/configure-kubernetes-master.sh
  2. +9
    -1
      magnum/drivers/common/templates/kubernetes/fragments/enable-services-master.sh

+ 0
- 1
magnum/drivers/common/templates/kubernetes/fragments/configure-kubernetes-master.sh View File

@@ -178,7 +178,6 @@ if [ "$NETWORK_DRIVER" = "calico" ]; then
KUBELET_ARGS="${KUBELET_ARGS} --network-plugin=cni --cni-conf-dir=/etc/cni/net.d --cni-bin-dir=/opt/cni/bin"
fi
KUBELET_ARGS="${KUBELET_ARGS} --register-with-taints=CriticalAddonsOnly=True:NoSchedule,dedicated=master:NoSchedule"
KUBELET_ARGS="${KUBELET_ARGS} --node-labels=node-role.kubernetes.io/master=\"\""

KUBELET_KUBECONFIG=/etc/kubernetes/kubelet-config.yaml
cat << EOF >> ${KUBELET_KUBECONFIG}

+ 9
- 1
magnum/drivers/common/templates/kubernetes/fragments/enable-services-master.sh View File

@@ -18,4 +18,12 @@ for service in etcd docker kube-apiserver kube-controller-manager kube-scheduler
echo "activating service $service"
systemctl enable $service
systemctl --no-block start $service
done
done

until [ "ok" = "$(curl --silent http://127.0.0.1:8080/healthz)" ] && \
kubectl patch node ${INSTANCE_NAME} \
--patch '{"metadata": {"labels": {"node-role.kubernetes.io/master": ""}}}'
do
echo "Trying to label master node with node-role.kubernetes.io/master=\"\""
sleep 5s
done

Loading…
Cancel
Save