Kubernetes Setup
Installing Minikube
https://minikube.sigs.k8s.io/docs/start
Installing kubectl
https://kubernetes.io/docs/tasks/tools/
Don't forget autocompletion!
Setting up a Local Kubernetes Cluster
-
Start Minikube:
> minikube start
warningIf you have
VirtualBox
orVMWare
(?), minikube defaults to using them over docker. This might be fine on your machine, but for some this operation will fail due to some configuration issues inside the BIOS. The simple solution is to tell minikube to usedocker
as the driver.> minikube start --driver=docker
-
Verify the cluster status:
> minikube status
> kubectl cluster-info -
Enable necessary addons:
> minikube addons enable ingress
> minikube addons enable dashboard -
Access the Kubernetes dashboard:
> minikube dashboard
-
Deploy a sample application:
> kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.10
> kubectl expose deployment hello-minikube --type=NodePort --port=8080 -
Access the deployed application:
> minikube service hello-minikube
A browser should have launched showing you some information about the sample application. Optionally, you can play with the app using
curl
:> curl 127.0.0.1:<YOUR PORT HERE> -d "edit me"
-
Clean up:
> kubectl delete service hello-minikube
> kubectl delete deployment hello-minikube -
Stop the Minikube cluster:
> minikube stop