Merge "[UUI] Service Mesh Compliance for UUI"
[oom.git] / kubernetes / contrib / metallb-loadbalancer-inst / install-metallb-on-cluster.sh
index ce5a19b..495d540 100755 (executable)
@@ -1,4 +1,5 @@
-#!/bin/bash -e
+#!/bin/sh -e
+
 #
 #   Copyright 2020 Samsung Electronics Co., Ltd.
 #
@@ -15,7 +16,8 @@
 #   limitations under the License.
 #
 
-usage() {
+usage()
+{
 cat << ==usage
 $0 Automatic configuration using external addresess from nodes
 $0 --help This message
@@ -27,10 +29,13 @@ $0 [cluster_ip1] ... [cluster_ipn]  Cluster address or ip ranges
 
 find_nodes_with_external_addrs()
 {
-    local WORKER_NODES=$(kubectl get no -l node-role.kubernetes.io/worker=true -o jsonpath='{.items..metadata.name}')
+    local WORKER_NODES
+    WORKER_NODES=$(kubectl get no -l node-role.kubernetes.io/worker=true -o jsonpath='{.items..metadata.name}')
     for worker in $WORKER_NODES; do
-        local external_ip=$(kubectl get no $worker  -o jsonpath='{.metadata.annotations.rke\.cattle\.io/external-ip }')
-        local internal_ip=$(kubectl get no $worker  -o jsonpath='{.metadata.annotations.rke\.cattle\.io/internal-ip }')
+        local external_ip
+        external_ip=$(kubectl get no $worker  -o jsonpath='{.metadata.annotations.rke\.cattle\.io/external-ip }')
+        local internal_ip
+        internal_ip=$(kubectl get no $worker  -o jsonpath='{.metadata.annotations.rke\.cattle\.io/internal-ip }')
         if [ $internal_ip != $external_ip ]; then
             echo $external_ip
         fi