forked from billimek/k8s-gitops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap-cluster.sh
executable file
·52 lines (44 loc) · 1.09 KB
/
bootstrap-cluster.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
REPO_ROOT=$(git rev-parse --show-toplevel)
need() {
which "$1" &>/dev/null || die "Binary '$1' is missing but required"
}
need "kubectl"
need "helm"
need "flux"
message() {
echo -e "\n######################################################################"
echo "# $1"
echo "######################################################################"
}
installFlux() {
message "installing fluxv2"
flux check --pre > /dev/null
FLUX_PRE=$?
if [ $FLUX_PRE != 0 ]; then
echo -e "flux prereqs not met:\n"
flux check --pre
exit 1
fi
if [ -z "$GITHUB_TOKEN" ]; then
echo "GITHUB_TOKEN is not set! Check $REPO_ROOT/setup/.env"
exit 1
fi
flux bootstrap github \
--owner=billimek \
--repository=k8s-gitops \
--branch master \
--private=false \
--personal \
--network-policy=false
FLUX_INSTALLED=$?
if [ $FLUX_INSTALLED != 0 ]; then
echo -e "flux did not install correctly, aborting!"
exit 1
fi
}
installFlux
"$REPO_ROOT"/setup/bootstrap-objects.sh
"$REPO_ROOT"/setup/bootstrap-vault.sh
message "all done!"
kubectl get nodes -o=wide