问题:在kubernetes service-cluster-ip-range地址网段明明配置的地址段10.10.10.0/24,但是Cluster Service IP居然使用是192.168.0.1。

kubernetes cluster IP  not with in the service CIDR

分析:

查看k8s中apiserver服务日志:
tail -f /data/logs/kubernetes/kube-apiserver/apiserver.stdout.log

the cluster IP 192.168.0.1 for service kubernetes/default is not within the service CIDR x.x.x.x/24; please recreate

kubernetes cluster IP  not with in the service CIDR

查看service信息:
kubectl describe service kubernetes

Warning Cluster IP Out Of Range 5m16s (x292 over 14h) ipallocator-repair-controller Cluster IP 192.168.0.1 is not with in the service CIDR 10.10.10.0/24; please recreate service

kubernetes cluster IP  not with in the service CIDR

#https://www.cnblogs.com/liucx/

解决问题:
使用命令:kubectl delete service kubernetes,然后系统会自动用新的ip重建这个service,就能解决

kubernetes cluster IP  not with in the service CIDR

删除ipvsadm规则 :

         ipvsadm -D -t  192.168.0.1:443

kubernetes cluster IP  not with in the service CIDR

 原因:经过回忆是因为中途修改过--service-cluster-ip-range地址,一开始以为是 apiserver-csr.json中签证hosts中IP顺序的问题,其实并不是,但是hosts必须要有service-cluster-ip-range网段中的第一个IP。后面重新deletet就解决了

相关文章:

  • 2022-12-23
  • 2021-08-18
  • 2022-02-05
  • 2021-08-29
  • 2021-05-21
  • 2022-01-18
  • 2022-12-23
  • 2021-10-23
猜你喜欢
  • 2021-08-06
  • 2022-12-23
  • 2021-08-16
  • 2021-09-20
  • 2021-12-30
  • 2021-12-09
  • 2022-12-23
相关资源
相似解决方案