Kubernetes 0
I got the book The DevOps 2.3 Toolkit: Kubernetes and this is my first day playing with kubernetes locally!
Schedulers, combined with containers and virtual machines, provide the ultimate cluster management nirvana. That will change in the future but, for now, container schedulers are the peak of engineering accomplishments. They allow us to combine the developer’s necessity for rapid and frequent deployments with a sysadmin’s goals of stability and reproducibility.
Zero-downtime deployments, fault tolerance, high availability, scaling, scheduling, and self-healing should be more than enough to see the value in Kubernetes.
The list of what Kubernetes does is long and rapidly increasing. Together with Docker, it is becoming a platform that envelops whole software development and deployment lifecycle.
I’m convinced!
Install
We need to install:
Docker is already installed, presumably.
Also, (some) subsequent commands assume:
git clone https://github.com/vfarcic/k8s-specs.git && cd k8s-specs
Basics
Start the virtual machine with cluster using:
minikube start --vm-driver=virtualbox
Communicate with the Docker host in the virtual machine:
minikube docker-env # echo details
eval $(minikube docker-env) # setup this shell
Imperatively spin up a pod…
kubectl run --generator=run-pod/v1 db --image mongo
Better yet, declaratively spin up a pod:
kubectl create -f pod/db.yml
Check its status:
kubectl describe pod db
kubectl describe -f pod/db.yml
Or all pods’ status:
# one-liner per pod, incuding ip
kubectl get pods --output wide
# lots and lots of info
kubectl get pods --output json
Execute a process on the running pod:
kubectl exec db ps aux
…and delete it:
kubectl delete pod db
Dashboard:
minikube dashboard
Stop and/or delete the VM:
minikube stop
minikube delete