cookeem / kubeadm-ha

通过kubeadm安装kubernetes高可用集群,使用docker/containerd容器运行时,适用v1.24.x以上版本
MIT License
679 stars 275 forks source link

node加入集群报错,连接地址不正确 #69

Closed FJiayang closed 3 years ago

FJiayang commented 3 years ago

执行完

# 在所有master节点上修改/etc/kubernetes/admin.conf
$ sed -i 's/:16443/:6443/g' /etc/kubernetes/admin.conf

之后,node加入集群报错,连接地址不正确

[root@k8s ~]# kubeadm join k8s-vip:6443 --token gqbn9i.4rcbkf8awdl9rfvd     --discovery-token-ca-cert-hash sha256:68076969836f5deb3cbf71b9b1a747ce987ec36e1daf9f291ead9620d8e4215f
[preflight] Running pre-flight checks
        [WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/
        [WARNING SystemVerification]: this Docker version is not on the list of validated versions: 20.10.5. Latest validated version: 19.03
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
error execution phase preflight: unable to fetch the kubeadm-config ConfigMap: failed to get config map: Get "https://192.168.1.39:16443/api/v1/namespaces/kube-system/configmaps/kubeadm-config?timeout=10s": dial tcp 192.168.1.39:16443: connect: connection refused
To see the stack trace of this error execute with --v=5 or higher

测试地址连通性

[root@k8s kubernetes]# curl -k https://k8s-vip:16443
curl: (7) Failed connect to k8s-vip:16443; 拒绝连接
[root@k8s kubernetes]# curl -k https://k8s-vip:6443
{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {

  },
  "status": "Failure",
  "message": "forbidden: User \"system:anonymous\" cannot get path \"/\"",
  "reason": "Forbidden",
  "details": {

  },
  "code": 403
cookeem commented 3 years ago

nginx-lb启动有问题,检查检查