使用 kubevip 进行多主 HA Kubernetes kubespray 安装失败

使用 kubevip 进行多主 HA Kubernetes kubespray 安装失败

我正在尝试使用 Kubespray 和 Kube VIP 安装 HA Kubernetes。我按照 Kubespray 的 Kube VIP 说明进行操作,但它卡在“TASK [kubernetes/control-plane : Kubeadm | Create kubeadm config]”上,直到 Kubespray 超时和失败,运行时我甚至看不到 VIP ip a

以下是 addons.yml 文件中 KubeVIP 的配置:

# Kube VIP
kube_vip_enabled: true
kube_vip_arp_enabled: true
kube_vip_controlplane_enabled: true
kube_vip_address: 192.168.2.63 # It is on the same subnet that node IP's are.
loadbalancer_apiserver:
  address: "{{ kube_vip_address }}"
  port: 6443
kube_vip_interface: ens192 # This is the interface that the node actual IP uses. I also tried the Interface altname for this.
kube_vip_services_enabled: false

我也设置了kube_proxy_strict_arp: true。这是 Kubespray 失败后第一个节点的 kubelet 日志:

Apr 24 22:00:00 knode1 kubelet[189461]: I0424 22:00:00.792273  189461 csi_plugin.go:880] Failed to contact API server when waiting for CSINode publishing: Get "https://lb-apiserver.kubernetes.local:6443/apis/storage.k8s.io/v1/csinodes/knode1": dial tcp 192.168.2.63:6443: connect: no route to host

这是输出kubectl cluster-info

[root@knode1 ~]# kubectl cluster-info
E0424 22:03:11.381987  190751 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E0424 22:03:11.382315  190751 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E0424 22:03:11.383693  190751 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E0424 22:03:11.384011  190751 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E0424 22:03:11.385271  190751 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
The connection to the server localhost:8080 was refused - did you specify the right host or port?

我是不是误解了什么或者做错了什么?非常感谢你的帮助。

相关内容