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:

  1. brew install caskroom/cask/virtualbox

Ubuntu:

  1. sudo apt-get install virtualbox

MiniKube VM (used for local kubernetes cluster development)

MacOS:

  1. brew cask install minikube

Ubuntu:

  1. 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)

  1. minikube config set memory 8000
  2. minikube config set cpus 2
  3. minikube set disk-size 100000MB

kubectl (Kubernetes command line utility):

MacOS:
1.brew install kubernetes-cli

Ubuntu:

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

bash-completion (needed to use for auto-completion of kubectl commands) MacOS:

  1. brew install bash-completion

RHEL:

  1. yum install bash-completion

Minikube usage

  • 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; otherwise minikube start is what to do)

  • Set environment to MiniKube
    In order to make all Docker images available to MiniKube, we issue the command eval $(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)

⚠️ **GitHub.com Fallback** ⚠️