Demo by - https://github.com/sixeyed/ These demo docs at https://is.gd/sinivi.
Session slides at https://is.gd/uquzut.
Video at https://youtu.be/dDLrvc9IVq4.
Run Kubernetes locally with Docker Desktop or kind, or use a playground like Play with Kubernetes or Katacoda.
Clone this repo & switch to the resources:
git clone --depth 1 https://github.com/sixeyed/presentations.git
cd presentations/linuxing-in-london/202005-kubernetes-101/
Walk through sleep.yaml.
Simple Pod:
kubectl apply -f sleep.yaml
kubectl get pods --show-labels
kubectl describe pod -l app=sleep
kubectl exec deploy/sleep -- hostname
Pod restart:
kubectl exec deploy/sleep -- killall5
kubectl get pods
Pod replacement:
kubectl delete pods -l app=sleep
kubectl get pods
Walk through bb-web-service.yaml and bb-web.yaml.
Deploy all:
kubectl apply -f web/
kubectl get svc
Check status:
kubectl get pods -l app=bb-web
kubectl logs -l app=bb-web
Check network:
kubectl get svc bb-web
kubectl exec deploy/sleep -- nslookup bb-web
kubectl exec deploy/sleep -- curl http://bb-web:8080
Walk through bb-db-service.yaml, bb-db.yaml and bb-db-secret.yaml.
Deploy all:
kubectl apply -f db/
kubectl get svc
kubectl get pods -l app=bb-db
kubectl logs -l app=bb-db
Check app status:
kubectl get pods -l app=bb-web
Get URL & browse:
kubectl get svc bb-web -o jsonpath='http://{.status.loadBalancer.ingress[0].*}:8080'
Scale up:
kubectl scale deploy/bb-web --replicas=3
kubectl get pods -l app=bb-web
kubectl get endpoints bb-web
Browse and refresh lots
Check load balancing:
kubectl logs -l app=bb-web --tail 1
All the objects are labelled with demo=kube101
, so we can delete them all using a label selector.
kubectl get all -l demo=kube101
kubectl delete all -l demo=kube101