版本:

docker desktop : 3.0.4(51218)
docker Engine:20.10.2
kubernetes:v1.19.3
image.png

镜像准备

  1. images=( # 下面的镜像应该去除"k8s.gcr.io/"的前缀,版本换成上面获取到的版本
  2. kube-apiserver:v1.19.3
  3. kube-controller-manager:v1.19.3
  4. kube-scheduler:v1.19.3
  5. kube-proxy:v1.19.3
  6. pause:3.2
  7. etcd:3.4.13-0
  8. coredns:1.6.7
  9. )
  10. for imageName in ${images[@]} ; do
  11. #docker pull k8s.gcr.io/$imageName
  12. docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/$imageName
  13. docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/$imageName k8s.gcr.io/$imageName
  14. docker rmi registry.cn-hangzhou.aliyuncs.com/google_containers/$imageName
  15. done

启动

相关命令

  1. docker运行日志:~/Library/Containers/com.docker.docker/Data/log
  2. 获取token
  3. kubectl -n kube-system describe secret default| awk '$1=="token:"{print $2}'

kubernetes-dashboard

从github上安装recommended.yaml 时注意namespaces是否一致,否则会无法正常访问:http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#/login