13
13
# See the License for the specific language governing permissions and
14
14
# limitations under the License.
15
15
16
+ # This script needs to run as the root user.
16
17
18
+ # There are two command line arguments (both optional) but quite important to understand
19
+ # $1 is the RELEASENAME you want to install from github
20
+ # $2 is the USER for whom to install this.
21
+
22
+ # Please make sure the user matches the one for which you installed and configured Kubernetes
23
+
24
+
25
+ DEFAULTRELEASENAME=" candair-0.3" # Change this as required with new tags (before you tag!!!)
26
+ date
17
27
echo " Starting BigBitBus Kubernetes Automation Toolkit (KAT) cluster application installations"
18
28
19
29
if [ ! -z $1 ]
20
30
then
21
- export INSTALLUSER=$1
31
+ export RELEASENAME=$1
32
+ else
33
+ export RELEASENAME=$DEFAULTRELEASENAME
34
+ fi
35
+
36
+ echo " Installing KAT release $RELEASENAME ."
37
+
38
+ export RELEASEDIRNAME=" kubernetes-automation-toolkit-" $RELEASENAME
39
+
40
+ if [ ! -z $2 ]
41
+ then
42
+ export INSTALLUSER=$2
22
43
else
23
44
export INSTALLUSER=$( ls /home/* -d | head -n 1 | cut -d/ -f3)
24
45
fi
@@ -27,44 +48,44 @@ export KUBECONFIG=/home/$INSTALLUSER/.kube/config
27
48
kubectl config set-context microk8s
28
49
cd /home/$INSTALLUSER
29
50
# Pull zipped files
30
- rm -rf bigbitbus-kat-main # Clean out any old run
31
- rm bigbitbus-kat-main .zip
32
- wget https://github.com/BigBitBusInc/kubernetes-automation-toolkit/archive/candair-0.2 .zip
33
- unzip bigbitbus-kat-main .zip
51
+ rm -rf $RELEASEDIRNAME # Clean out any old run
52
+ rm $RELEASENAME .zip
53
+ wget https://github.com/BigBitBusInc/kubernetes-automation-toolkit/archive/$RELEASENAME .zip
54
+ unzip $RELEASENAME .zip
34
55
35
56
36
57
# Postgres
37
- cd /home/$INSTALLUSER /bigbitbus-kat-main /code/k8s-common-code/postgres-db/
58
+ cd /home/$INSTALLUSER /$RELEASEDIRNAME /code/k8s-common-code/postgres-db/
38
59
helm repo add bitnami https://charts.bitnami.com/bitnami
39
60
helm repo update
40
61
helm upgrade --install pgdb bitnami/postgresql -f pg-values.yaml --namespace pg --create-namespace
41
62
42
63
# Monitoring
43
- cd /home/$INSTALLUSER /bigbitbus-kat-main /code/k8s-common-code/monitoring/
64
+ cd /home/$INSTALLUSER /$RELEASEDIRNAME /code/k8s-common-code/monitoring/
44
65
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
45
66
helm repo add stable https://charts.helm.sh/stable
46
67
helm repo update
47
68
helm upgrade --install monitoring-stack prometheus-community/kube-prometheus-stack -f ./prometheus-grafana-monitoring-stack-values.yaml --namespace monitoring --create-namespace
48
69
49
70
# K8s Dashboard
50
- cd /home/$INSTALLUSER /bigbitbus-kat-main /code/k8s-common-code/k8sdashboard/
71
+ cd /home/$INSTALLUSER /$RELEASEDIRNAME /code/k8s-common-code/k8sdashboard/
51
72
helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/
52
73
helm repo update
53
74
helm upgrade --install k8sdashboard kubernetes-dashboard/kubernetes-dashboard -f ./dashboard-values.yaml --namespace dashboard --create-namespace
54
75
55
76
# Backend
56
77
kubectl create namespace be
57
- cd /home/$INSTALLUSER /bigbitbus-kat-main /code/app-code/api/todo-python-django/
78
+ cd /home/$INSTALLUSER /$RELEASEDIRNAME /code/app-code/api/todo-python-django/
58
79
skaffold run --default-repo localhost:32000
59
80
60
81
# Frontend
61
82
kubectl create namespace fe
62
- cd /home/$INSTALLUSER /bigbitbus-kat-main /code/app-code/frontend/todo-vuejs/
83
+ cd /home/$INSTALLUSER /$RELEASEDIRNAME /code/app-code/frontend/todo-vuejs/
63
84
skaffold run --default-repo localhost:32000
64
85
65
- chown -R $INSTALLUSER :$INSTALLUSER /home/$INSTALLUSER /bigbitbus-kat-main /
86
+ chown -R $INSTALLUSER :$INSTALLUSER /home/$INSTALLUSER /$RELEASEDIRNAME /
66
87
cd /home/$INSTALLUSER
67
- rm bigbitbus-kat-main .zip
88
+ rm $RELEASENAME .zip
68
89
# Print what was deployed for later debugging
69
90
kubectl get all --all-namespaces
70
91
echo " Ended BigBitBus Kubernetes Automation Toolkit (KAT) application installation script"
0 commit comments