-
check if microk8s is installed
->microk8s status
-
check mircok8s add-ons
->microk8s status
(look for)--> dashboard --> dns --> helm (heml3) --> hostpath-storage --> ingress --> rbac --> registry --> storage
- create storage paths
-> /var/lib/postgresql/data
-> /mnt/data
-
create the frontend & restapi images locally
->docker-compose build
-
port the images to microk8s
->sudo docker save [image name] > [image name].tar
->sudo microk8s ctr image import [image name].tar
-
check if images are in locall registry
->microk8s ctr images list
(look for REF)
--> docker.io/library/frontend:latest
--> docker.io/library/restapi:latest
- install cert-manager
->kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.11.0/cert-manager.yaml
-
gcp artifcat registry create/ update
->sudo docker tag [image-name] europe-west4-docker.pkg.dev/sc-32-376820/survey-app/[image-name]:tag
-
gcp push image
->docker push europe-west4-docker.pkg.dev/sc-32-376820/survey-app/[image-name]:tag
-
create gcp compatible helm chart
->helm package .\surveyapp-helm\
-
push compiled helm chart to gcp
->helm push surveyapp-helm-0.1.1.tgz oci://europe-west4-docker.pkg.dev/sc-32-376820/survey-app
-
run the helm chart
->helm install [release-name] oci://europe-west4-docker.pkg.dev/sc-32-376820/survey-app/surveyapp-helm --version 0.1.1
-
run the helm chart
->sudo microk8s helm3 install [name] ./surveyapp-helm
-
test role based access
->kubectl auth can-i get pod --namespace default --as sc
-
find the restapi pod name
->kubectl get pods
(look for)
--> restapi-deployment-[hash] -
connect to restapi pod
->kubectl exec -it restapi-deployment-[hash] /bin/bash
-
migrate database to postgresql (inside pod terminal starts with #)
->python manage.py migrate
-
exit pod terminal
-> Ctrl + P
-
check the port for the frontend
->kubectl get svc
(look for)
--> frontend-service (e.g., 4200:32478/TCP -> localhost:32478 is the IP) -
open a browser
-
enter URL: localhost:[port] (e.g., localhost:32478)
-
uninstall helm chart
->sudo microk8s helm3 delete $(microk8s helm3 list --short)
-
unistall specific chart
->helm uninstall [release-name]