Calico 启用 eBPF 过程中遇到的问题:”error getting ClusterInformation”
Kubernetes 集群准备使用 eBPF,参考 Calico 的帮助文档 Enable the eBPF dataplane,在配置Configure Calico to talk directly to the API server 过程中添加 ConfigMap 后
kind: ConfigMap
apiVersion: v1
metadata:
name: kubernetes-services-endpoint
namespace: kube-system
data:
KUBERNETES_SERVICE_HOST: "k8s-api"
KUBERNETES_SERVICE_PORT: "443"
calico-kube-controllers pod 无法启动,错误信息如下:
Failed to create pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container "xxx" network for pod "calico-kube-controllers-56fcbf9d6b-45zpf":
networkPlugin cni failed to set up pod "calico-kube-controllers-56fcbf9d6b-45zpf_kube-system" network: error getting ClusterInformation: Get "https://[k8s-api]:443/apis/crd.projectcalico.org/v1/clusterinformations/default":
dial tcp 10.0.9.171:443: connect: connection refused, failed to clean up sandbox container "xxx" network for pod "calico-kube-controllers-56fcbf9d6b-45zpf":
networkPlugin cni failed to teardown pod "calico-kube-controllers-56fcbf9d6b-45zpf_kube-system" network:
error getting ClusterInformation: Get "https://[k8s-api]:443/apis/crd.projectcalico.org/v1/clusterinformations/default": dial tcp 10.0.9.171:443: connect: connection refused]
请问如何解决?
回答
端口后写错引起,应该是 6443
KUBERNETES_SERVICE_PORT: "6443"