minikube - nlpie/nlp-adapt-kube GitHub Wiki
Installation (MacOS and Ubuntu 16.04 >) (see here for Kubeadm cluster installation)
MiniKube is a good way to create a single node Kubernetes cluster for testing Docker containers within a Kubernetes/Argo workflow before deploying them into production.
Requirements: TODO
VirtualBox
MacOS:
brew install caskroom/cask/virtualbox
Ubuntu:
sudo apt-get install virtualbox
MiniKube VM (used for local kubernetes cluster development)
MacOS:
brew cask install minikube
Ubuntu:
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.28.2/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
Configure MiniKube (only need to do once)
-
minikube config set memory 8000
-
minikube config set cpus 2
-
minikube set disk-size 100000MB
kubectl (Kubernetes command line utility):
MacOS:
1.brew install kubernetes-cli
Ubuntu:
-
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 -
-
sudo touch /etc/apt/sources.list.d/kubernetes.list
-
echo "deb http://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
bash-completion (needed to use for auto-completion of kubectl
commands)
MacOS:
brew install bash-completion
RHEL:
yum install bash-completion
-
Start minikube VM
minikube --memory 3000 --cpus 2 --disk-size 60g start
(set environment with memory, cpu and disk: only needs to be done first time you run minikube; otherwiseminikube start
is what to do) -
Set environment to MiniKube
In order to make all Docker images available to MiniKube, we issue the commandeval $(minikube docker-env)
-
Get service endpoint in browser
minikube service es
-
Start Minikube dashboard
minikube dashboard
-
SSH to minikube If you need to ssh into the MiniKube cluster, issue the command
minikube ssh
-
Set Kubernetes privileges
kubectl create rolebinding default-admin --clusterrole=admin --serviceaccount=default:default
-
SSH to deployed pod
kubectl exec -it <POD ID> -- /bin/bash
-
Stop (delete) MiniKube cluster
minikube stop
(minikube delete
NB: this command destroys everything in the MiniKube environment; only use if you plan on rebuilding everything)