|
47 | 47 | echo "Targeting user $INSTALLUSER for application-code installation"
|
48 | 48 | export KUBECONFIG=/home/$INSTALLUSER/.kube/config
|
49 | 49 | kubectl config set-context microk8s
|
50 |
| -cd /home/$INSTALLUSER |
| 50 | +cd "/home/$INSTALLUSER" |
| 51 | +pwd |
51 | 52 | # Pull zipped files
|
52 | 53 | rm -rf $RELEASEDIRNAME # Clean out any old run
|
53 | 54 | rm $RELEASENAME.zip
|
54 | 55 | wget https://github.com/BigBitBusInc/kubernetes-automation-toolkit/archive/$RELEASENAME.zip
|
55 | 56 | unzip $RELEASENAME.zip
|
56 |
| - |
| 57 | +echo "Tried to download and unzip $RELEASENAME.zip; pwd has these files:" |
| 58 | +ls |
57 | 59 |
|
58 | 60 | # Postgres
|
59 |
| -cd /home/$INSTALLUSER/$RELEASEDIRNAME/code/k8s-common-code/postgres-db/ |
| 61 | +echo "Installing Postgres" |
| 62 | +cd "/home/$INSTALLUSER/$RELEASEDIRNAME/code/k8s-common-code/postgres-db/" |
| 63 | +pwd |
60 | 64 | helm repo add bitnami https://charts.bitnami.com/bitnami
|
61 | 65 | helm repo update
|
62 | 66 | helm upgrade --install pgdb bitnami/postgresql -f pg-values.yaml --namespace pg --create-namespace --version 12.2.7
|
63 | 67 |
|
64 | 68 | # Monitoring
|
65 |
| -cd /home/$INSTALLUSER/$RELEASEDIRNAME/code/k8s-common-code/monitoring/ |
| 69 | +echo "Installing Monitoring" |
| 70 | +cd "/home/$INSTALLUSER/$RELEASEDIRNAME/code/k8s-common-code/monitoring/" |
| 71 | +pwd |
66 | 72 | helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
|
67 | 73 | helm repo add stable https://charts.helm.sh/stable
|
68 | 74 | helm repo update
|
69 | 75 | helm upgrade --install monitoring-stack prometheus-community/kube-prometheus-stack -f ./prometheus-grafana-monitoring-stack-values.yaml --namespace monitoring --create-namespace --version 12.8.1
|
70 | 76 |
|
71 | 77 | # K8s Dashboard
|
72 |
| -cd /home/$INSTALLUSER/$RELEASEDIRNAME/code/k8s-common-code/k8sdashboard/ |
| 78 | +echo "Installing K8s dashboard" |
| 79 | +cd "/home/$INSTALLUSER/$RELEASEDIRNAME/code/k8s-common-code/k8sdashboard/" |
| 80 | +pwd |
73 | 81 | helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/
|
74 | 82 | helm repo update
|
75 | 83 | helm upgrade --install k8sdashboard kubernetes-dashboard/kubernetes-dashboard -f ./dashboard-values.yaml --namespace dashboard --create-namespace
|
76 | 84 |
|
77 | 85 | # Backend
|
| 86 | +echo "Installing BE" |
78 | 87 | kubectl create namespace be
|
79 |
| -cd /home/$INSTALLUSER/$RELEASEDIRNAME/code/app-code/api/todo-python-django/ |
| 88 | +cd "/home/$INSTALLUSER/$RELEASEDIRNAME/code/app-code/api/todo-python-django/" |
| 89 | +pwd |
80 | 90 | skaffold run --default-repo localhost:32000
|
81 | 91 |
|
82 | 92 | # Frontend
|
| 93 | +echo "Installing FE" |
83 | 94 | kubectl create namespace fe
|
84 |
| -cd /home/$INSTALLUSER/$RELEASEDIRNAME/code/app-code/frontend/todo-vuejs/ |
| 95 | +cd "/home/$INSTALLUSER/$RELEASEDIRNAME/code/app-code/frontend/todo-vuejs/" |
| 96 | +pwd |
85 | 97 | skaffold run --default-repo localhost:32000
|
86 | 98 |
|
| 99 | +echo "Finishing up" |
87 | 100 | chown -R $INSTALLUSER:$INSTALLUSER /home/$INSTALLUSER/$RELEASEDIRNAME/
|
88 |
| -cd /home/$INSTALLUSER |
| 101 | +cd "/home/$INSTALLUSER" |
| 102 | +pwd |
89 | 103 | rm $RELEASENAME.zip
|
90 | 104 | # Print what was deployed for later debugging
|
91 | 105 | kubectl get all --all-namespaces
|
|
0 commit comments