curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
If old minikube version is present is hanging machine on minikube start
then do following or jump to next section.
# If old minikube instance is running then delete it.
sudo minikube stop
sudo minikube delete
sudo rm -rf ~/.minikube
# Download minikube
wget https://github.com/kubernetes/minikube/releases/download/v0.24.0/minikube_0.24-0.deb
# Install minikube
sudo dpkg -i minikube_0.24-0.deb
# Start minikube vm-driver=none option
sudo minikube start --vm-driver=none
# Change permission
sudo chown -R $USER $HOME/.kube
sudo chgrp -R $USER $HOME/.kube
sudo chown -R $USER $HOME/.minikube
sudo chgrp -R $USER $HOME/.minikube
$ kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system kube-addon-manager-satya-thinkpad-e470 1/1 Running 1 6m
If kube-dns isn't installed by default then try below steps to install. To make sure that kube-dns & kube-dashboard are installed you should get those pods in the above output.
# Install kube-dns ReplicationController
kubectl apply -f https://raw.githubusercontent.com/kubernetes/minikube/k8s-v1.5/deploy/addons/kube-dns/kube-dns-rc.yaml
# Create service for kube-dns
kubectl apply -f https://raw.githubusercontent.com/satyamz/minikube/satyamz-invalid-ip-fix/deploy/addons/kube-dns/kube-dns-svc.yaml
# Install kube-dashboard
kubectl apply -f https://raw.githubusercontent.com/kubernetes/minikube/k8s-v1.5/deploy/addons/dashboard/dashboard-rc.yaml
# Create kube-dashboard service
kubectl apply -f https://raw.githubusercontent.com/kubernetes/minikube/k8s-v1.5/deploy/addons/dashboard/dashboard-svc.yaml
kubectl get pods,svc --all-namespaces
Output should be like:
satya@satya-ThinkPad-E470:~$ kubectl get pods,svc --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system po/kube-addon-manager-satya-thinkpad-e470 1/1 Running 1 51m
kube-system po/kube-dns-v20-xrpbq 3/3 Running 0 34m
kube-system po/kubernetes-dashboard-6wdtg 1/1 Running 0 32m
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
default svc/kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 52m
kube-system svc/kube-dns ClusterIP 10.107.134.137 <none> 53/UDP,53/TCP 32m
kube-system svc/kubernetes-dashboard NodePort 10.97.166.16 <none> 80:30000/TCP 31m