Preparation

  • Install Kubectl
  • Install Virtual Box

Installation

Get Mac OSX image
curl -Lo minikube http://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/releases/v0.25.2/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/

Build local kubernetes environment with virtual box
minikube start --registry-mirror=https://registry.docker-cn.com

Open Kubernetes dashboard
minikube dashboard
Kubernetes Dashboard

Test

Run a Nginx Pod
kubectl run hello-world --image=nginx --port=80

Expose Nginx Service
kubectl expose deployment hello-world --type=NodePort

Get Pod and Service status
kubectl get pod

kubectl get service

Test with browser