Skip to content

Commit a3de174

Browse files
authored
Merge pull request #21 from BigBitBusInc/fix/add-logging
Adding more logging
2 parents e6f4ca1 + 0017f39 commit a3de174

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

code/local-kubernetes-cluster-installation/install-application-stack.sh

+22-8
Original file line numberDiff line numberDiff line change
@@ -47,45 +47,59 @@ fi
4747
echo "Targeting user $INSTALLUSER for application-code installation"
4848
export KUBECONFIG=/home/$INSTALLUSER/.kube/config
4949
kubectl config set-context microk8s
50-
cd /home/$INSTALLUSER
50+
cd "/home/$INSTALLUSER"
51+
pwd
5152
# Pull zipped files
5253
rm -rf $RELEASEDIRNAME # Clean out any old run
5354
rm $RELEASENAME.zip
5455
wget https://github.com/BigBitBusInc/kubernetes-automation-toolkit/archive/$RELEASENAME.zip
5556
unzip $RELEASENAME.zip
56-
57+
echo "Tried to download and unzip $RELEASENAME.zip; pwd has these files:"
58+
ls
5759

5860
# 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
6064
helm repo add bitnami https://charts.bitnami.com/bitnami
6165
helm repo update
6266
helm upgrade --install pgdb bitnami/postgresql -f pg-values.yaml --namespace pg --create-namespace --version 12.2.7
6367

6468
# 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
6672
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
6773
helm repo add stable https://charts.helm.sh/stable
6874
helm repo update
6975
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
7076

7177
# 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
7381
helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/
7482
helm repo update
7583
helm upgrade --install k8sdashboard kubernetes-dashboard/kubernetes-dashboard -f ./dashboard-values.yaml --namespace dashboard --create-namespace
7684

7785
# Backend
86+
echo "Installing BE"
7887
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
8090
skaffold run --default-repo localhost:32000
8191

8292
# Frontend
93+
echo "Installing FE"
8394
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
8597
skaffold run --default-repo localhost:32000
8698

99+
echo "Finishing up"
87100
chown -R $INSTALLUSER:$INSTALLUSER /home/$INSTALLUSER/$RELEASEDIRNAME/
88-
cd /home/$INSTALLUSER
101+
cd "/home/$INSTALLUSER"
102+
pwd
89103
rm $RELEASENAME.zip
90104
# Print what was deployed for later debugging
91105
kubectl get all --all-namespaces

code/local-kubernetes-cluster-installation/install-microk8s-on-ubuntu.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ apt-get install -y fail2ban vim
4949
apt-get install unzip
5050

5151
# Note - we pegged the Kubernetes version here
52-
snap install microk8s --classic --channel=1.19
5352
curl -fsSL https://get.docker.com -o get-docker.sh
5453
sh get-docker.sh
54+
snap install microk8s --classic --channel=1.19
5555
snap install kubectl --classic --channel=1.19
5656
snap install helm --classic --channel=3.4
5757
sleep 60 # Sometimes microk8s needs time to stabilize

0 commit comments

Comments
 (0)