Minikube

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

External

Internal

Overview

Minikube is a tool that installs Kubernetes locally. Minikube runs a single-node Kubernetes cluster inside a VM on the local development machine. To install it, it requires virtualization extensions enabled in your system's BIOS.

Installation

Latest Version

https://github.com/kubernetes/minikube/tags

Mac

https://minikube.sigs.k8s.io/docs/start/
brew install minikube

The installation will automatically add a "minikube" context.

Uninstallation

brew uninstall minikube

Note that uninstallation does not clean the context.

Linux

Dependencies: minikube 1.18 and newer require installing conntrack:

Conntrack | Installation

Delete the old minikube, if any.

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo mv ./minikube-linux-amd64 /usr/local/bin/minikube
chmod a+x /usr/local/bin/minikube

Before starting the new minikube, remove or backup old ~/.minikube.

Then:

minikube start

Uninstall followed by Installation

Uninstall the old minikube. Become root:

sudo su

As root:

minikube stop
minikube delete --all --purge
rm -rf /root/.kube /root/.minikube /home/ec2-user/.kube /home/ec2-user/.minikube
rm /usr/local/sbin/minikube
rm /usr/local/sbin/kubectl

Uninstall the new minikube. As root:

cd /tmp
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
mv ./minikube-linux-amd64 /usr/local/sbin/minikube
chmod a+x /usr/local/sbin/minikube
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
mv ./kubectl /usr/local/sbin/kubectl
chmod a+x /usr/local/sbin/kubectl

As ec2-user:

minikube start -v=7 --vm-driver=none --kubernetes-version "v1.19.1"
minikube update-context
minikube status
minikube service list
minikube addons list

As ec2-user, test minikube availability:

kubectl get nodes
NAME                                        STATUS   ROLES    AGE    VERSION
ip-10-1-10-220.us-west-2.compute.internal   Ready    master   117s   v1.19.1

kubectl -n kube-system get pods
NAME                                                                READY   STATUS    RESTARTS   AGE
coredns-f9fd979d6-hwqbq                                             1/1     Running   0          2m25s
etcd-ip-10-1-10-220.us-west-2.compute.internal                      1/1     Running   0          75s
kube-apiserver-ip-10-1-10-220.us-west-2.compute.internal            1/1     Running   0          87s
kube-controller-manager-ip-10-1-10-220.us-west-2.compute.internal   1/1     Running   0          74s
kube-proxy-nwc87                                                    1/1     Running   0          2m25s
kube-scheduler-ip-10-1-10-220.us-west-2.compute.internal            1/1     Running   0          82s
storage-provisioner                                                 1/1     Running   1          2m40s

Concepts

Minikube Concepts

Configuration

Configuration

Operations

Minikube Operations