Kubernetes serves two purposes: It scales and starts containers across multiple Docker hosts, balancing the containers across them. It also adds a higher level API to define how containers are logically grouped, allowing defining pools of containers, loading balancing, and affinity. Kubernetes is defined by states, not processes.
A Pod represents a running process on your cluster.
A Service defines a logical set of Pods and a policy by which to access them.
A Deployment provides declarative updates for Pods. You only need to describe the desired state in a Deployment object, and the Deployment controller will change the actual state to the desired state for you.
Minikube is the recommended method to create a single node Kubernetes cluster locally for purposes of development and testing.
Installing Minikube (along with Docker and VirtualBox) via Homebrew:
brew update && brew install kubectl && brew cask install docker minikube virtualbox
Verifying:
docker --version
docker-compose --version
docker-machine --version
minikube version
kubectl version --client
Starting Minikube:
minikube start
Great! Minikube started a virtual machine for you, and a Kubernetes cluster is now running in that VM.
Setting Docker environment variables:
eval $(minikube docker-env)
docker build -t hello-node:v1 .
kubectl apply -f service.yaml
curl $(minikube service hello-node --url)
minikube dashboard
Deleting deployment and service:
kubectl delete service,deployment hello-node
Stopping Minikube:
minikube stop
To be continued...