KUBERNETES WORKSHOP
BY WALTER
INTRODUCTION
ME
▸ Walter Liu
▸
▸
▸ /
▸
Before workshop
Container
Docker Moby
TEXT
WHY CONTAINERS?
▸ Create new instances in seconds
▸ Same images, environments across dev, test, production
▸ Agile deployment
▸ Lesser troubleshooting time about environments
difference.
Why Kubernetes?
TEXT
WHY KUBERNETES?
▸ Manage containers
▸ Mounting storage systems
▸ Distributing secrets/config
▸ Checking application health
▸ Replicating application
instances
▸ Horizontal Autoscaling
▸ Naming and discovering
▸ Balancing loads
▸ Rolling updates
▸ Monitoring resources
▸ Accessing and ingesting
logs
▸ Debugging applications
▸ Infrastructure as code
USING KUBERNETES
COMPONENTS USED IN THIS WORKSHOP
▸ POD
▸ Label
▸ Deployment
▸ Service
TEXT
LAB - POD
▸ Create a POD
▸ shell into that POD
▸ kubectl exec -it <pod_name> -c <container_name>
bash
▸ touch a file
▸ kubectl delete that POD; create it again.
▸ shell into that POD and check if that file is existed.
TEXT
LAB - DEPLOYMENT
▸ Create a nginx pod by using deployment.
▸ Enlarge that deployment to 3 pods.
▸ Change to new nginx version.
USING KUBERNETES
SERVICE
▸ K8S Internal service
▸ External service
▸ TCP Load Balancer
▸ [optional] Firewall
▸ *Global Load Balancer
▸ with Ingress
TEXT
LAB - SERVICE
▸ Expose that nginx service by using K8S service
▸ minikube service nginx-service —url
▸ View that nginx page.
USING KUBERNETES
ADDITIONAL COMPONENTS
▸ Statefulset
▸ Secrets/ConfigMap
▸ Endpoints
▸ Ingress
▸ Learn more about Google Load Balancer
USING KUBERNETES
STATEFULSET
▸ Like deployment with static POD name
▸ prod-nimo-kvs-0
▸ prod-nimo-kvs-1
▸ Usage: Sharded service
▸ redis
▸ memcached
▸ Other usage: static volume
USING KUBERNETES
SECRETES/CONFIGMAP
▸ Usage: environment variables for Django settings
▸ No git for secretes
USING KUBERNETES
ENDPOINTS
▸ Usage: IPs of external resources
USING KUBERNETES
INGRESS
▸ Global Load Balancer
▸ No firewall ability
USING KUBERNETES
K8S+GCP LOAD BALANCER
▸ GCP Global Load Balancer
▸ GCP TCP Load Balancer
▸ GCP Internal Load Balancer (1.7 beta support)
▸ K8S Internal Load Balancer
Ingress
Service
Deployment/POD Statefulset/POD GCP Cloud SQL
Service Service/Endpoints
TEXT
TROUBLESHOOTING
▸ kubectl describe …
▸ kubectl get … (for example <pod/pod_name>)
▸ kubectl logs <pod_name> -c <container_name>
▸ kubectl exec -it <pod_name> -c <container_name> bash
▸ kubectl top (not for minikube)
▸ dashboard
Q & A

Kubernetes Workshop