minikube
minikube 只適合來學習 kubernetes 的單機版使用環境. production 請用 Google Container Engine, RedHat OpenShift Origin or Enterprise 或其他 kubenetes 實作, AWS, Azure, CenturyLink Cloud 等.
 
Minikube 只支援 Kubernetes 以下功能:
  • DNS
  • NodePorts
  • ConfigMaps and Secrets
  • Dashboards
 

Getting Started

安裝需求
  • 無需安裝 docker engine
安裝 kubectl
安裝 minikube
 
安裝 minikube(on windows, 設定在path路徑下)
 
使用 minikube 指令
  • $ minikube start
  • $ minikube status
  • $ minikube docker-env
  • $ minikube dashboard
  • $ minikube service hello-minikube // 先用 kubectl 安裝 hello-minikube
  • $ minikube stop // 暫停 minikube 虛擬主機
  • $ minikube delete // 刪掉整個 local kubenetes cluster
  •  
使用 docker 指令
  • 將 docker command 連入 minikube 的 docker engine
  • $ eval $(minikube docker-env)
  • $ docker ps // 看到 minikube 裡的 docker containers
  • $ docker images // 看到 minikube 裡的 images
  • PS.當出現 Error response from daemon: client is newer than server (client API version: 1.24, server API version: 1.23)錯誤時,可透過設定 DOCKER_API_VERSION 環境變數來解決
  •  
使用 kubectl 指令
  • 開一個新的 namespace
  • $ kubectl create namespace devops-meetup
  • $ kubectl get namespace // 看有哪些 namespace
 
 
  • 用指令執行 hellow-minikube 
  • $ kubectl run hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --port=8080
  • $ kubectl expose deployment hello-minikube --type=NodePort
  • $ minikube service hello-minikube