Minikube Installation Guide
Follow these steps to run Minikube on your mac
-
Install Docker
-
Install VirtualBox
-
Install Kubectl
-
Install Minikube
Install docker on Mac
brew cask install docker
Install VirtualBox latest version 6.x and above
Check the VirtualBox version
$ echo $(virtualbox --help | head -n 1 | awk '{print $NF}')
brew cask uninstall --force virtualbox
brew cask install virtualbox
Install Kubectl
brew install kubernetes-cli (1)
1 | Refer troubleshooting sections about version issues. |
Install Minikube v1.0.1
Make sure you delete older versions , if you have issue with minikube dashboard
minikube delete
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v1.0.1/minikube-darwin-amd64 && chmod +x minikube && sudo cp minikube /usr/local/bin/ && rm minikube
Don’t use homebrew to install minikube which pulls latest version you may face to start. use stable version. |
Starting MiniKube
minikube requires access to the internet via HTTP, HTTPS, and DNS protocols.
If a HTTP proxy is required to access the internet, you may need to pass the proxy connection information to both minikube and Docker using environment variables:
HTTP_PROXY - The URL to your HTTP proxy HTTPS_PROXY - The URL to your HTTPS proxy NO_PROXY - A comma-separated list of hosts which should not go through the proxy. The NO_PROXY variable here is important: Without setting it, minikube may not be able to access resources within the VM. minikube uses two IP ranges, which should not go through the proxy:
192.168.99.0/24: Used by the minikube VM. Configurable for some hypervisors via --host-only-cidr 192.168.39.0/24: Used by the minikube kvm2 driver. 10.96.0.0/12: Used by service cluster IP’s. Configurable via --service-cluster-ip-range
Use below command to start your minikube , if it not behind corporate proxy
export NO_PROXY=localhost,127.0.0.1,10.96.0.0/12,192.168.99.0/24,192.168.39.0/24
tvajjala$minikube start --docker-env NO_PROXY=$NO_PROXY
๐ minikube v1.0.1 on darwin (amd64)
๐คน Downloading Kubernetes v1.14.1 images in the background ...
๐ฅ Creating virtualbox VM (CPUs=2, Memory=2048MB, Disk=20000MB) ...
๐ถ "minikube" IP address is 192.168.99.102
๐ Found network options:
▪ NO_PROXY=localhost,127.0.0.1,10.96.0.0/12,192.168.99.0/24,192.168.39.0/24
๐ณ Configuring Docker as the container runtime ...
▪ env NO_PROXY=localhost,127.0.0.1,10.96.0.0/12,192.168.99.0/24,192.168.39.0/24
๐ณ Version of container runtime is 18.06.3-ce
⌛ Waiting for image downloads to complete ...
✨ Preparing Kubernetes environment ...
๐ Pulling images required by Kubernetes v1.14.1 ...
๐ Launching Kubernetes v1.14.1 using kubeadm ...
⌛ Waiting for pods: apiserver proxy etcd scheduler controller dns
๐ Configuring cluster permissions ...
๐ค Verifying component health .....
๐ kubectl is now configured to use "minikube"
๐ Done! Thank you for using minikube!
if your network behind proxy, use below command |
export HTTP_PROXY=http://<proxy hostname:port>
export HTTPS_PROXY=https://<proxy hostname:port>
export NO_PROXY=localhost,127.0.0.1,10.96.0.0/12,192.168.99.0/24,192.168.39.0/24
minikube start --docker-env=HTTP_PROXY=$HTTP_PROXY --docker-env HTTPS_PROXY=$HTTPS_PROXY \
--docker-env NO_PROXY=$NO_PROXY
Read more on Using Minikube with an HTTP Proxy
Status check
tvajjala$minikube status
host: Running
kubelet: Running
apiserver: Running
kubectl: Correctly Configured: pointing to minikube-vm at 192.168.99.102
Command to view Minikube Dashboard
tvajjala$minikube dashboard
๐ Enabling dashboard ...
๐ค Verifying dashboard health ...
๐ Launching proxy ...
๐ค Verifying proxy health ...
๐ Opening http://127.0.0.1:56008/api/v1/namespaces/kube-system/services/http:kubernetes-dashboard:/proxy/ in your default browser...
Command to view all components status
$ kubectl get all --namespace=kube-system
Command to view ConfigMap
$ kubectl get configmap -n kube-system
Command to view deployments
$ kubectl get deployment --all-namespaces
Command to iew all pods
$ kubectl get pods --all-namespaces
Command to view specific pod logs
kubectl --namespace kube-system logs <POD_NAME>
to view specific pod name run below command |
kubectl get pods --all-namespaces
-
Describe pod*
kubectl -n kube-system describe po <POD_NAME>
kubectl create role access-secrets --verb=get,list,watch,update,create --resource=secrets
kubectl create rolebinding --role=access-secrets default-to-secrets --serviceaccount=kube-system:default
Cluster information
kubectl cluster-info
kubectl apply -f deployment.yaml
invalid object doesn’t have additional properties
Troubleshoot kubectl version incompatibility
tvajjala$kubectl version
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.7", GitCommit:"0c38c362511b20a098d7cd855f1314dad92c2780", GitTreeState:"clean", BuildDate:"2018-08-20T10:09:03Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:02:58Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}
stable kubectl
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl
If your kubectl still showing older version , make sure you have other versions installed
my case i have Google SDK which causing issue, follow below steps to delete or upgrade GCK
Locate your installation directory by running:
gcloud info --format='value(installation.sdk_root)' Locate your user config directory (typically ~/.config/gcloud on MacOS and Linux) by running:
gcloud info --format='value(config.paths.global_config_dir)' Delete both these directories.
Additionally, remove lines sourcing completion.bash.inc and paths.bash.inc in your .bashrc or equivalent shell init file, if you added them during installation
and finally it solved the problem
tvajjala$kubectl version
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:11:31Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:02:58Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}
Comments
Post a Comment