docker+rancher搭建k8s 报错笔记
CentOS 7
docker v1.20.x
rancher v2.3.5
内网环境 无法出外网
ps:采用Nexus3作为docker镜像仓库代理,Nexus3的代理的相关安装配置见这里
ETCD无法创建问题
没有外网,经常出现docker 镜像无法拉取的情况,rancher正常启动后,登录到webui界面,开始创建k8s集群,发现抱错,etcd无法创建如下
查看了一下rancher容器运行log,日志如下
2022/02/14 13:34:14 [WARNING] Failed to create Docker container [etcd] on host [192.168.1.1]: Error response from daemon: No such image: rancher/coreos-etcd:v3.4.3-rancher1
2022/02/14 13:34:14 [ERROR] cluster [c-rc4nk] provisioning: [etcd] Failed to bring up Etcd Plane: Failed to create [etcd] container on host [192.168.1.1]: Failed to create Docker container [etcd] on host [192.168.1.1]: <nil>
2022/02/14 13:34:14 [INFO] kontainerdriver rancherkubernetesengine stopped
2022/02/14 13:34:14 [ERROR] ClusterController c-rc4nk [cluster-provisioner-controller] failed with : [etcd] Failed to bring up Etcd Plane: Failed to create [etcd] container on host [192.168.1.1]: Failed to create Docker container [etcd] on host [192.168.1.1]: <nil>
2022/02/14 13:37:44 [ERROR] Error parsing max age Error parsing auth refresh max age: time: invalid duration s
rancher/coreos-etcd:v3.4.3-rancher1
docker镜像无法拉取,没法后面从其他地方pull取该镜像,再推到Nexus中
[etcd] Failed to bring up Etcd Plane
ETCD启动失败问题,这个是个经典的问题,网上很多教程,就是得重新删除干净,重启docker服务
[etcd] Failed to bring up Etcd Plane: etcd cluster is unhealthy: hosts [192.168.154.231] failed to report healthy. Check etcd container logs on each host for more information
清除的指令如下
docker stop $(docker ps -aq)
# 注意,这个会把所用容器删除
docker system prune -f
# 注意,这个会清空所有volume
docker volume rm $(docker volume ls -q)
# 注意,这个会清空所有image
docker image rm $(docker image ls -q)
rm -rf /etc/ceph \<