Skip to content

Commit

Permalink
Merge pull request #21 from BigBitBusInc/fix/add-logging
Browse files Browse the repository at this point in the history
Adding more logging
  • Loading branch information
bigbitbus authored May 1, 2023
2 parents e6f4ca1 + 0017f39 commit a3de174
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,45 +47,59 @@ fi
echo "Targeting user $INSTALLUSER for application-code installation"
export KUBECONFIG=/home/$INSTALLUSER/.kube/config
kubectl config set-context microk8s
cd /home/$INSTALLUSER
cd "/home/$INSTALLUSER"
pwd
# Pull zipped files
rm -rf $RELEASEDIRNAME # Clean out any old run
rm $RELEASENAME.zip
wget https://github.com/BigBitBusInc/kubernetes-automation-toolkit/archive/$RELEASENAME.zip
unzip $RELEASENAME.zip

echo "Tried to download and unzip $RELEASENAME.zip; pwd has these files:"
ls

# Postgres
cd /home/$INSTALLUSER/$RELEASEDIRNAME/code/k8s-common-code/postgres-db/
echo "Installing Postgres"
cd "/home/$INSTALLUSER/$RELEASEDIRNAME/code/k8s-common-code/postgres-db/"
pwd
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
helm upgrade --install pgdb bitnami/postgresql -f pg-values.yaml --namespace pg --create-namespace --version 12.2.7

# Monitoring
cd /home/$INSTALLUSER/$RELEASEDIRNAME/code/k8s-common-code/monitoring/
echo "Installing Monitoring"
cd "/home/$INSTALLUSER/$RELEASEDIRNAME/code/k8s-common-code/monitoring/"
pwd
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo add stable https://charts.helm.sh/stable
helm repo update
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

# K8s Dashboard
cd /home/$INSTALLUSER/$RELEASEDIRNAME/code/k8s-common-code/k8sdashboard/
echo "Installing K8s dashboard"
cd "/home/$INSTALLUSER/$RELEASEDIRNAME/code/k8s-common-code/k8sdashboard/"
pwd
helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/
helm repo update
helm upgrade --install k8sdashboard kubernetes-dashboard/kubernetes-dashboard -f ./dashboard-values.yaml --namespace dashboard --create-namespace

# Backend
echo "Installing BE"
kubectl create namespace be
cd /home/$INSTALLUSER/$RELEASEDIRNAME/code/app-code/api/todo-python-django/
cd "/home/$INSTALLUSER/$RELEASEDIRNAME/code/app-code/api/todo-python-django/"
pwd
skaffold run --default-repo localhost:32000

# Frontend
echo "Installing FE"
kubectl create namespace fe
cd /home/$INSTALLUSER/$RELEASEDIRNAME/code/app-code/frontend/todo-vuejs/
cd "/home/$INSTALLUSER/$RELEASEDIRNAME/code/app-code/frontend/todo-vuejs/"
pwd
skaffold run --default-repo localhost:32000

echo "Finishing up"
chown -R $INSTALLUSER:$INSTALLUSER /home/$INSTALLUSER/$RELEASEDIRNAME/
cd /home/$INSTALLUSER
cd "/home/$INSTALLUSER"
pwd
rm $RELEASENAME.zip
# Print what was deployed for later debugging
kubectl get all --all-namespaces
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ apt-get install -y fail2ban vim
apt-get install unzip

# Note - we pegged the Kubernetes version here
snap install microk8s --classic --channel=1.19
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
snap install microk8s --classic --channel=1.19
snap install kubectl --classic --channel=1.19
snap install helm --classic --channel=3.4
sleep 60 # Sometimes microk8s needs time to stabilize
Expand Down

0 comments on commit a3de174

Please sign in to comment.