更新时间:2024-09-29 GMT+08:00

K8s废弃资源检查异常处理

检查项内容

检查集群是否存在对应版本已经废弃的资源。

解决方案

  • 问题场景一: 1.25及以上集群中的service存在废弃的annotation:tolerate-unready-endpoints

    报错日志信息如下:

    some check failed in cluster upgrade: this cluster has deprecated service list: map[***] with deprecated annotation list [tolerate-unready-endpoints]

    检查日志信息中所给出的service是否存在"tolerate-unready-endpoints"的annotation,如果存在则将其去掉,并在对应的service的spec中添加下列字段来替代该annotation:

    publishNotReadyAddresses: true
  • 问题场景二: 1.27及以上集群中的service存在废弃的annotation:service.kubernetes.io/topology-aware-hints

    报错日志信息如下:

    some check failed in cluster upgrade: this cluster has deprecated service list: map[***] with deprecated annotation list [service.kubernetes.io/topology-aware-hints]

    检查日志信息中所给出的service是否存在"service.kubernetes.io/topology-aware-hints"的annotation,如果存在则将其去掉,并在对应的service中用"service.kubernetes.io/topology-mode"的annotation进行替换。