Update documentation for Cluster-API and Flux
[icn.git] / deploy / cluster-api / cluster-api.sh
1 #!/usr/bin/env bash
2 set -eux -o pipefail
3
4 SCRIPTDIR="$(readlink -f $(dirname ${BASH_SOURCE[0]}))"
5 LIBDIR="$(dirname $(dirname ${SCRIPTDIR}))/env/lib"
6
7 source $LIBDIR/logging.sh
8 source $LIBDIR/common.sh
9
10 function deploy {
11     export EXP_CLUSTER_RESOURCE_SET=true
12     clusterctl init --infrastructure=metal3:${CAPM3_VERSION}
13 }
14
15 function clean {
16     clusterctl delete --all
17 }
18
19 case $1 in
20     "clean") clean ;;
21     "deploy") deploy ;;
22     *) cat <<EOF
23 Usage: $(basename $0) COMMAND
24
25 Commands:
26   clean         - Remove Cluster API
27   deploy        - Deploy Cluster API
28 EOF
29        ;;
30 esac