A presentation given to fellow frontend engineers about how learning Kubernetes can make you a better frontend developer.
Presentation slides are available: http://peter.serwylo.com/cognizant-k8s-pres.
The presentation tries to describe why you may wish to use k8s from first principles, but doesn't explain what k8s is or how it is used. To showcase this, a demo is really required. Hence, once the end of the presentation was reached, I did the following to build up an intuition about some of the concepts in k8s:
Show details of demo
- Log into OpenShift and show a full deployment of the frontend + backend from
./k8s/04-health-checks
. - Remove the deployment to make space to start from first principles:
kubectl delete all --all
- Create silly pods to showcase the simplest (and silliest) deployment in k8s:
kubectl find ./k8s/00-building-blocks/ -iname "*.yaml" | xargs yq | kubectl apply -f -
- Remove the pods to make space for proper Deployment + Service version:
kubectl delete all --all
- Showcase how a deployment is a better way to manage containers:
kubectl apply -f ./k8s/01-basic/frontend/deployment.yaml
- Explain that services are required to route traffic to a collection of pods:
kubectl apply -f ./k8s/01-basic/frontend/service.yaml
- Open up traffic to the world using an (OpenShift specific) route:
kubectl apply -f ./k8s/01-basic/frontend/route.yaml
- After viewing a misconfigured app, move on to explain how config maps are used to provide per-environment configuration, and then how to mount the configmap into the deployment. Note that after updating the deployment, a rolling restart is performed:
kubectl apply -f ./k8s/02-configmap/frontend/configmap.yaml
kubectl apply -f ./k8s/02-configmap/frontend/deployment.yaml
- Showcase resource limits:
find ./k8s/03-limits/ -iname "*.yaml" | xargs yq | kubectl apply -f -
- Explain the need for health checks:
find ./k8s/04-health-checks/ -iname "*.yaml" | xargs yq | kubectl apply -f -
- Remove the manually created resources, then run a helm install to show one approach to managing a collection of k8s resources:
kubectl delete all --all
helm install app ./k8s/05-helm
Two basic apps used to in the presentation to illustrate some basic concepts of deploying containers. The frontend is based on create-react-app and the backend is created using express.
These are built into docker images available at pserwylo/cognizant-k8s-pres-frontend:latest and pserwylo/cognizant-k8s-pres-backend:latest respectively.
The slide deck used to present this material is available at: http://peter.serwylo.com/cognizant-k8s-pres.
Starting from basic principles, through to (slightly) more complex topics such as deployments, configmaps, resource limits, etc.
There is also a bunch of 0x-
folders that are empty, only present to highlight that we could continue to show more
and more of the complex beast that is k8s if we chose.
Toy, non-functioning examples used to generate screenshots for the presentation.