diff options
author | Rihab Banday <rihab.banday@ericsson.com> | 2020-10-07 18:35:42 +0200 |
---|---|---|
committer | Georg Kunz <georg.kunz@ericsson.com> | 2020-10-21 15:07:51 +0000 |
commit | b4c77ac1045904b4c46af23f5b79a6e50f0de948 (patch) | |
tree | f18e2e26f7469bdae36a5a0f674ceb87cd5570d8 | |
parent | 86544f7980c95916fd828bc8bdf4df903d4c720d (diff) |
Modify setup_network function to add support for Node 3-5
This change modifies setup_network function to add support
for configuring networking for pod 19 node 3,4 and 5.
Change-Id: I9cbdedfe57b86b0b64f96a51ede0ad7b2490d797
Signed-off-by: Rihab Banday <rihab.banday@ericsson.com>
Reviewed-on: https://gerrit.opnfv.org/gerrit/c/kuberef/+/71243
Tested-by: jenkins-ci <jenkins-opnfv-ci@opnfv.org>
Reviewed-by: Georg Kunz <georg.kunz@ericsson.com>
Reviewed-by: Victor Morales <chipahuac@hotmail.com>
-rwxr-xr-x | functions.sh | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/functions.sh b/functions.sh index 26db3c6..5b4a3fd 100755 --- a/functions.sh +++ b/functions.sh @@ -145,16 +145,19 @@ EOF # Setup networking on provisioned hosts (Adapt setup_network.sh according to your network setup) setup_network() { - MASTER_IP=$(get_host_pxe_ip "nodes[0]") - WORKER_IP=$(get_host_pxe_ip "nodes[1]") +# Set Upper limit of number nodes in RI2 cluster (starting from 0) +NODE_MAX_ID=$(($(yq r "$CURRENTPATH"/hw_config/"$VENDOR"/idf.yaml --length idf.kubespray.hostnames)-1)) + +for idx in $(seq 0 "$NODE_MAX_ID") +do + NODE_IP=$(get_host_pxe_ip "nodes[${idx}]") # SSH to jumphost # shellcheck disable=SC2087 ssh -o StrictHostKeyChecking=no -tT "$USERNAME"@"$(get_vm_ip)" << EOF -ssh -o StrictHostKeyChecking=no root@$MASTER_IP \ - 'bash -s' < ${PROJECT_ROOT}/${VENDOR}/setup_network.sh -ssh -o StrictHostKeyChecking=no root@$WORKER_IP \ +ssh -o StrictHostKeyChecking=no root@${NODE_IP} \ 'bash -s' < ${PROJECT_ROOT}/${VENDOR}/setup_network.sh EOF +done } # k8s Provisioning (currently BMRA) |