From 502f18cf28a68fb3a739149480e8d549e87c3421 Mon Sep 17 00:00:00 2001 From: MengxinLiu Date: Thu, 12 Mar 2020 13:38:26 +0800 Subject: [PATCH] feat: add label param in install script --- dist/images/install.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dist/images/install.sh b/dist/images/install.sh index 73d20764099..a632c3b7ec8 100644 --- a/dist/images/install.sh +++ b/dist/images/install.sh @@ -5,15 +5,20 @@ REGISTRY="index.alauda.cn/alaudak8s" POD_CIDR="10.16.0.0/16" # Do NOT overlap with NODE/SVC/JOIN CIDR SVC_CIDR="10.96.0.0/12" # Do NOT overlap with NODE/POD/JOIN CIDR JOIN_CIDR="100.64.0.0/16" # Do NOT overlap with NODE/POD/SVC CIDR +LABEL="node-role.kubernetes.io/master" # The node label to deploy OVN DB VERSION="v1.1.0-pre" echo "[Step 1] Label kube-ovn-master node" -kubectl label no -lnode-role.kubernetes.io/master kube-ovn/role=master --overwrite +count=$(kubectl get no -l$LABEL --no-headers -o wide | wc -l | sed 's/ //g') +if [ "$count" = "0" ]; then + echo "ERROR: No node with label $LABEL" + exit 1 +fi +kubectl label no -l$LABEL kube-ovn/role=master --overwrite echo "-------------------------------" echo "" echo "[Step 2] Install OVN components" -count=$(kubectl get no -lkube-ovn/role=master --no-headers -o wide | wc -l) addresses=$(kubectl get no -lkube-ovn/role=master --no-headers -o wide | awk '{print $6}' | tr \\n ',') echo "Install OVN DB in $addresses"