how to configure minikube

  • install kubectl
sudo apt-get update && sudo apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update
sudo apt-get install -y kubectl

install kubectl binary using native package
https://kubernetes.io/docs/tasks/tools/install-kubectl/


  • install minikube
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.31.0/minikube-linux-amd64 && chmod +x minikube && sudo cp minikube /usr/local/bin/ && rm minikube
kubectl cluster-info [dump]

find the latest version of minikube
https://github.com/kubernetes/minikube/releases


  • start minikube cluster
curl -L https://github.com/dhiltgen/docker-machine-kvm/releases/download/v0.10.0/docker-machine-driver-kvm-ubuntu16.04
chmod +x docker-machine-driver-kvm
sudo mv docker-machine-driver-kvm /usr/local/bin/docker-machine-driver-kvm
minikube start --vm-driver=kvm
minikube ip
kubectl create deployment hello-node --image=gcr.io/hello-minikube-zero-install/hello-node --port=8080
kubectl get deployments
kubectl get pods
kubectl get events
kubectl config view
kubectl expose deployment hello-node --type=LoadBalancer
kubectl get services
kubectl get pods,services -n kube-system
minikube service hello-node
curl $(minikube service hello-node --url)
minikube addons list
minikube addons enable dashboard
minikube dashboard
kubectl delete services hello-node
kubectl delete deployment hello-node
minikube stop
minikube delete

the default VM driver seems VirtualBox.
so if you want to change the VM driver, download the appropriate one and add –vm-driver=xxx flag to minikube start.
minikube start --vm-driver=kvm


reference
https://kubernetes.io/docs/tutorials/hello-minikube/
https://kubernetes.io/docs/setup/minikube/
https://kubernetes.io/docs/tasks/tools/install-minikube/

Leave a Reply

Your email address will not be published.