无法同步 kubernetes 服务:发布 https://[::1]:6443

问题描述

现状

我使用 k8s 集群没有问题,但在重新启动节点后,除了获取和列表之外,我无法执行任何操作(创建、删除、更新)。 我可以在 api-server 日志中看到这样的错误

E0220 12:59:16.933815       1 reflector.go:178] k8s.io/client-go/informers/factory.go:135: Failed to list *v1.ResourceQuota: Get https://[::1]:6443/api/v1/resourcequotas?resourceVersin=2727847: dial tcp [::1]:6443: connect: cannot assign requested address
E0220 12:59:19.584540       1 reflector.go:178] k8s.io/client-go/informers/factory.go:135: Failed to list *v1.PersistentVolume: Get https://[::1]:6443/api/v1/persistentvolumes?resourcVersion=2730108: dial tcp [::1]:6443: connect: cannot assign requested address
E0220 12:59:20.862950       1 reflector.go:178] k8s.io/client-go/informers/factory.go:135: Failed to list *v1.StorageClass: Get https://[::1]:6443/apis/storage.k8s.io/v1/storageclasse?resourceVersion=2727847: dial tcp [::1]:6443: connect: cannot assign requested address
E0220 12:59:23.528011       1 controller.go:223] unable to sync kubernetes service: Post https://[::1]:6443/api/v1/namespaces: dial tcp [::1]:6443: connect: cannot assign requested adress
E0220 12:59:23.791957       1 reflector.go:178] k8s.io/client-go/informers/factory.go:135: Failed to list *v1.Pod: Get https://[::1]:6443/api/v1/pods?resourceVersion=3793709: dial tcp[::1]:6443: connect: cannot assign requested address
E0220 12:59:24.718812       1 status.go:71] apiserver received an error that is not an Metav1.Status: &url.Error{Op:"Get",URL:"https://[::1]:6443/api/v1/namespaces/test/resourceuotas",Err:(*net.OpError)(0xc002ff5f40)}
I0220 13:56:41.532831       1 event.go:278] Event(v1.ObjectReference{Kind:"Deployment",Namespace:"kubernetes-dashboard",Name:"kubernetes-dashboard",UID:"1f60ae9c-0014-48e4-8ff7-bee30f0a2cae",APIVersion:"apps/v1",ResourceVersion:"3849690",Fieldpath:""}): type: 'Warning' reason: 'replicasetCreateError' Failed to create new replica set "kubernetes-dashboard-69fff65949": Get https://[::1]:6443/api/v1/namespaces/kubernetes-dashboard/resourcequotas: dial tcp [::1]:6443: connect: cannot assign requested address

问题

  • 为什么 api 服务器消耗 ipv6 [::1] 即使我没有使用它?

环境:

  • Kubernetes 版本
client: v1.20.2
server: v1.18.15
  • 云提供商或硬件配置:
Local bareMetal server
  • 操作系统
NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
  • 内核
Linux poweredge-r730 4.15.0-135-generic #139-Ubuntu SMP Mon Jan 18 17:38:24 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
  • 安装工具: 我使用 kubeadm 安装了 k8s 集群。
  • 网络插件和版本 使用 Calico v3.10.4

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)