miniKube 單機版的 Kubernetes

miniKube 是 Google 發布可以在單機上面跑 Kubernetes 的工具,安裝跟使用都相當簡單.由於會在本地跑一個 VM ,不用擔心費用問題。

『Minikube is a tool that makes it easy to run Kubernetes locally. Minikube runs a single-node Kubernetes cluster inside a VM on your laptop for users looking to try out Kubernetes or develop with it day-to-day.』

安裝 minikube

// 安裝
$>curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.6.0/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/

安裝 Google Cloud SDK

  • 安裝好之後,會有 gcloud, gsutil
$>curl https://sdk.cloud.google.com | bash

安裝 kubectl

  • 請重新開啟 terminal
$>gcloud components install kubectl

comand line 執行

$>eval $(minikube docker-env)

// 啟動/停止 cluster. This command creates and configures a virtual machine that runs a single-node Kubernetes cluster.
$>minikube start / stop

// Deleting a Cluster
$>minikube delete

// 連接VM
$>minikube ssh

// 顯示版本
$>minikube dashboard

其他類似管理工具