X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=deploy%2Fmetal3-vm%2F03_launch_mgmt_cluster.sh;h=93789e1229e10e31374af889c9a2e3d477abba3b;hb=refs%2Fchanges%2F73%2F3873%2F2;hp=ab25c736225114bedd53dff3c411ff6e1ae70a07;hpb=06e42f9aff0d369a8d7f4f48b309f313003f2d7e;p=icn.git diff --git a/deploy/metal3-vm/03_launch_mgmt_cluster.sh b/deploy/metal3-vm/03_launch_mgmt_cluster.sh index ab25c73..93789e1 100755 --- a/deploy/metal3-vm/03_launch_mgmt_cluster.sh +++ b/deploy/metal3-vm/03_launch_mgmt_cluster.sh @@ -1,5 +1,5 @@ -#!/bin/bash -set -xe +#!/usr/bin/env bash +set -eux -o pipefail # shellcheck disable=SC1091 source lib/logging.sh @@ -8,6 +8,8 @@ source lib/common.sh eval "$(go env)" export GOPATH +DEPLOYDIR="$(dirname "$PWD")" +BMODIR=$DEPLOYDIR/metal3/scripts/bmo # Environment variables # M3PATH : Path to clone the metal3 dev env repo @@ -23,8 +25,8 @@ M3PATH="${GOPATH}/src/github.com/metal3-io" BMOPATH="${M3PATH}/baremetal-operator" BMOREPO="${BMOREPO:-https://github.com/metal3-io/baremetal-operator.git}" -BMOBRANCH="${BMOBRANCH:-3d40caa29dce82878d83aeb7f8dab4dc4a856160}" -FORCE_REPO_UPDATE="${FORCE_REPO_UPDATE:-false}" +BMOBRANCH="${BMOBRANCH:-10eb5aa3e614d0fdc6315026ebab061cbae6b929}" +FORCE_REPO_UPDATE="${FORCE_REPO_UPDATE:-true}" BMO_RUN_LOCAL="${BMO_RUN_LOCAL:-false}" COMPUTE_NODE_PASSWORD="${COMPUTE_NODE_PASSWORD:-mypasswd}" @@ -49,17 +51,13 @@ function clone_repos { } function launch_baremetal_operator { - pushd "${BMOPATH}" - if [ "${BMO_RUN_LOCAL}" = true ]; then - touch bmo.out.log - touch bmo.err.log - make deploy - kubectl scale deployment metal3-baremetal-operator -n metal3 --replicas=0 - nohup make run >> bmo.out.log 2>>bmo.err.log & - else - make deploy - fi - popd + docker pull integratedcloudnative/baremetal-operator:v1.0-icn + kubectl apply -f $BMODIR/namespace/namespace.yaml + kubectl apply -f $BMODIR/rbac/service_account.yaml -n metal3 + kubectl apply -f $BMODIR/rbac/role.yaml -n metal3 + kubectl apply -f $BMODIR/rbac/role_binding.yaml + kubectl apply -f $BMODIR/crds/metal3.io_baremetalhosts_crd.yaml + kubectl apply -f $BMODIR/operator/no_ironic/operator.yaml -n metal3 } network_config_files() { @@ -80,6 +78,8 @@ runcmd: EOF } +# documentation for the values below may be found at +# https://cloudinit.readthedocs.io/en/latest/topics/modules.html create_userdata() { name="$1" COMPUTE_NODE_FQDN="$name.akraino.icn.org" @@ -122,7 +122,7 @@ EOF } function make_bm_hosts { - while read -r name address user password mac; do + while IFS=',' read -r name address user password mac; do create_userdata $name apply_userdata_credential $name go run "${BMOPATH}"/cmd/make-bm-worker/main.go \ @@ -145,7 +145,6 @@ function apply_bm_hosts { list_nodes | make_bm_hosts } - clone_repos launch_baremetal_operator apply_bm_hosts