Enable Kubernetes on Docker for Mac in China
NOTE:
- It is tested on Docker for Mac 18.05 (with Kubernetes 1.10.3)
- Ubuntu Install Kubernetes with Kubeadm. see kubernetes-for-china
Install
-
Install Docker for Mac
-
Config registry mirror for Docker daemon with
https://registry.docker-cn.com
- Preload Kubernetes images form Alibaba Cloud Registry Service, NOTE: you can modify the
images.properties
for your own images
$ ./load_images.sh
- Enable Kubernetes in Docker for Mac, and wait a while for Kubernetes is running
- Optional: switch the context to docker-for-desktop
$ kubectl config use-context docker-for-desktop
- Verify Kubernetes installation
$ kubectl cluster-info
$ kubectl get nodes
- Deploy Kubernetes dashboard
$ kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml
# creates proxy server
$ kubectl proxy
# access dashboard at:
http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/.
# get dashboard admin privileges https://github.com/kubernetes/dashboard/wiki/Access-control#admin-privileges
Helm
# use homebrew
$ brew install kubernetes-helm
# initialize the local CLI and also install Tiller into your Kubernetes cluster
$ helm init
# update charts repo
$ helm repo update
# install mysql chart
$ helm install --name my-mysql stable/mysql
# delete
$ helm delete my-mysql
# remove the release from the store and make its name free for later use
$ helm delete --purge my-mysql