Set proper role for worker node
Since it's not possible to self assign node labels such as role it must be done after bootstrap process. [1] [1] https://cluster-api.sigs.k8s.io/user/troubleshooting.html#labeling-nodes-with-reserved-labels-such-as-node-rolekubernetesio-fails-with-kubeadm-error-during-bootstrap Signed-off-by: Ruslan Aliev <raliev@mirantis.com> Change-Id: I5163bcd4ddc8c74900904d8032b215406b4c513d
This commit is contained in:
@@ -9,7 +9,7 @@ spec:
|
|||||||
nodeRegistration:
|
nodeRegistration:
|
||||||
name: '{{ ds.meta_data.name }}'
|
name: '{{ ds.meta_data.name }}'
|
||||||
kubeletExtraArgs:
|
kubeletExtraArgs:
|
||||||
node-labels: 'metal3.io/uuid={{ ds.meta_data.uuid }},node-type=worker'
|
node-labels: 'metal3.io/uuid={{ ds.meta_data.uuid }}'
|
||||||
provider-id: 'metal3://{{ ds.meta_data.uuid }}'
|
provider-id: 'metal3://{{ ds.meta_data.uuid }}'
|
||||||
feature-gates: "IPv6DualStack=true"
|
feature-gates: "IPv6DualStack=true"
|
||||||
ntp:
|
ntp:
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ set -xe
|
|||||||
export TIMEOUT=${TIMEOUT:-3600}
|
export TIMEOUT=${TIMEOUT:-3600}
|
||||||
export KUBECONFIG=${KUBECONFIG:-"$HOME/.airship/kubeconfig"}
|
export KUBECONFIG=${KUBECONFIG:-"$HOME/.airship/kubeconfig"}
|
||||||
export KUBECONFIG_TARGET_CONTEXT=${KUBECONFIG_TARGET_CONTEXT:-"target-cluster"}
|
export KUBECONFIG_TARGET_CONTEXT=${KUBECONFIG_TARGET_CONTEXT:-"target-cluster"}
|
||||||
|
WORKER_NODE="node03"
|
||||||
|
|
||||||
echo "Stop ephemeral node"
|
echo "Stop ephemeral node"
|
||||||
sudo virsh destroy air-ephemeral
|
sudo virsh destroy air-ephemeral
|
||||||
@@ -25,7 +26,11 @@ sudo virsh destroy air-ephemeral
|
|||||||
node_timeout () {
|
node_timeout () {
|
||||||
end=$(($(date +%s) + $TIMEOUT))
|
end=$(($(date +%s) + $TIMEOUT))
|
||||||
while true; do
|
while true; do
|
||||||
if (kubectl --request-timeout 20s --kubeconfig $KUBECONFIG --context $KUBECONFIG_TARGET_CONTEXT get $1 node03 | grep -qw $2) ; then
|
if (kubectl --request-timeout 20s --kubeconfig $KUBECONFIG --context $KUBECONFIG_TARGET_CONTEXT get $1 $WORKER_NODE | grep -qw $2) ; then
|
||||||
|
if [ "$1" = "node" ]; then
|
||||||
|
kubectl --kubeconfig $KUBECONFIG --context $KUBECONFIG_TARGET_CONTEXT label nodes $WORKER_NODE node-role.kubernetes.io/worker=""
|
||||||
|
fi
|
||||||
|
|
||||||
echo -e "\nGet $1 status"
|
echo -e "\nGet $1 status"
|
||||||
kubectl --kubeconfig $KUBECONFIG --context $KUBECONFIG_TARGET_CONTEXT get $1
|
kubectl --kubeconfig $KUBECONFIG --context $KUBECONFIG_TARGET_CONTEXT get $1
|
||||||
break
|
break
|
||||||
@@ -42,7 +47,7 @@ node_timeout () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo "Deploy worker node"
|
echo "Deploy worker node"
|
||||||
airshipctl phase run workers-target --debug
|
airshipctl phase run workers-target --debug
|
||||||
|
|
||||||
echo "Waiting $TIMEOUT seconds for bmh to be in ready state."
|
echo "Waiting $TIMEOUT seconds for bmh to be in ready state."
|
||||||
node_timeout bmh ready
|
node_timeout bmh ready
|
||||||
|
|||||||
Reference in New Issue
Block a user