minikube start
Local k8s implementation to test k8s locally
minikube stop
minikube delete
Sometimes necessary to clear local state before running start again
kubectl get nodes
kubectl get pods
kubectl get deployments
kubectl get services
kubectl scale deployments/<deployment_name> --replicas=<desired_number>
Fun command but bot won't receive this kind of traffic
kubectl set image deployments/<deployment_name> <deployment_name>=<new_docker_image_name>
This will perform a rolling update
kubectl rollout undo deployments/<deployment_name>
Undo a rolling update back to previous state
minikube dashboard
minikube start
kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.10
Create deployment
kubectl expose deployment hello-minikube --type=NodePort --port=8080
Create service using the newly created deployment
kubectl get pod
Verify pod is launched and ready
minikube service hello-minikube --url
- View the url to see status page
kubectl delete services hello-minikube
kubectl delete deployment hello-minikube
minikube stop
minikube delete
minikube docker-env
eval $(minikube -p minikube docker-env)
- Service recovery if bot goes down
- Rolling deployments (no downtime)
- Single master node
- 1 or many Nodes
- The workers in the cluster
- Runs a Kubelet to communicate with master
- Runs a container runtime
- Logical abstraction that can represent a group of one or more containers
- Containers in a pod share the same IP address and ports
- Containers in a pod run in a shared-context
- In a pod you might run a persistent volume app and web server app together
- A configuration file that master will use to maintain state
- This is the self-healing part of k8s
- Node goes down? Machine failure? Master will re-run the config
- Allows applications to receive traffic
- ClusterIP - service is available within the same cluster
- NodePort - service is available outside the cluser
- LoadBalancer - creates fixed external IP
- ExternalName - exposes service by name (CNAME record)
- Services are exposed Deployments meaning traffic can come through