Updated on 2025-10-28 GMT+08:00

Discarded Kubernetes Resources

Check Items

Check whether there are discarded resources in the clusters.

Solutions

  • Scenario 1: The Services in the clusters v1.25 or later have deprecated annotation tolerate-unready-endpoints.

    Error log:

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

    In this example, check the log to see if the Service (test-svc) has the tolerate-unready-endpoints annotation. This annotation indicates whether the endpoint controller should continue creating endpoints for unready pods. If the deprecated annotation exists, delete it and add the following field to the Service's spec as a replacement. For details, see ServiceSpec.

    1. Run the kubectl command to modify the YAML file of the Service.
      kubectl edit service test-svc
    2. Delete the tolerate-unready-endpoints annotation and add the following field to spec to replace the annotation:
      publishNotReadyAddresses: true

  • Scenario 2: The Services in the clusters v1.27 or later has deprecated annotation service.kubernetes.io/topology-aware-hints.

    Error log:

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

    In this example, check the log to see if the Service (test-svc) contains the service.kubernetes.io/topology-aware-hints annotation. This annotation was used to enable topology aware hints in Services. However, this function has been renamed. If the deprecated annotation exists, delete it and use service.kubernetes.io/topology-mode as a replacement (for details, see Topology Aware Routing):

    1. Run the kubectl command to modify the YAML file of the Service.
      kubectl edit service test-svc
    2. Delete the service.kubernetes.io/topology-aware-hints annotation and add the service.kubernetes.io/topology-mode annotation to spec.