我 kubectl get events
的时候,发现了一个告警:
Warning ClusterIPOutOfRange service/mongo-svc Cluster IP [IPv4]:10.51.169.247 is not within the service CIDR 10.254.0.0/16; please recreate service
查看错误详情:
apiVersion: events.k8s.io/v1
kind: Event
metadata:
creationTimestamp: '2023-08-19T04:12:55Z'
name: mongo-svc.177cad8b9b1fa0c5
deprecatedSource:
component: ipallocator-repair-controller
note: >-
Cluster IP [IPv4]:10.51.169.247 is not within the service CIDR 10.254.0.0/16;
please recreate service
reason: ClusterIPOutOfRange
regarding:
apiVersion: v1
kind: Service
name: mongo-svc
type: Warning
请问我该如何解决?
你的CIDR的范围是
10.254.0.0/16
,你创建的服务ip是10.51.169.247
不在这个范围里,删除这个service,重新创建(默认分配新的ip)或者修改ip到这个范围里即可。谢谢,是这个原因。
你的答案