Lab Minikube (based on official tutorial on https://kubernetes.io)
- Launch GitHub Codespace
- Run
minikube start
to start cluster - Run
minikube dashboard --url
to view dashboard in a new terminal - Hover over link and "follow link"
- Create a deployment:
kubectl create deployment hello-node --image=registry.k8s.io/e2e-test-images/agnhost:2.39 -- /agnhost netexec --http-port=8080
- View deployment:
kubectl get deployments
- View pods:
kubectl get pods
- Create service and expose it:
kubectl expose deployment hello-node --type=LoadBalancer --port=8080
- View services:
kubectl get services
- Curl the url shown, for example:
curl http://192.168.49.2:31839
or change to your URL. - Cleanup
kubectl delete service hello-node
kubectl delete deployment hello-node
minikube stop
docker build .
docker image ls
#find image
docker run -p 127.0.0.1:8080:8080 93fa55efa692
- Clone repo into Cloud9 (pick a machine with decent size CPU and RAM if possible, but students should use micro)
- Add ssh keys to GitHub
- resize to bigger disk
- Create virtualenv and add to bashrc and source
python3 -m venv ~/.venv && echo 'source ~/.venv/bin/activate' >> ~/.bashrc && source ~/.bashrc
- cd into checkout and run
make install
- Preview running FastAPI app after running: python main.py