docker: 19.03.8
minikube: 1.8.2
kubernetes: 1.16.7
kubectl: 1.16.7
一、安装docker环境
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum -y install docker-ce
systemctl daemon-reload && systemctl restart docker
二、下载minikube
curl -Lo minikube http://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/releases/v1.8.2/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
或者从本地拷贝
三、配置镜像加速
https://cr.console.aliyun.com/cn-huhehaote/instances/mirrors
四、启动k8s
这里直接使用主机的docker环境安装k8s,不使用虚拟机方式。如果失败,就多试几次就可以了
minikube delete;
minikube start --vm-driver=none \
--image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers \
--kubernetes-version='v1.16.7'
五、安装kubectl
cp ~/.minikube/cache/linux/v1.16.7/kubectl /usr/local/sbin
六、查看集群状态
# kubectl get nodes
NAME STATUS ROLES AGE VERSION
minikube Ready master 28m v1.16.7
注:阿里云国内ECS安装成功