To rename the SLB instance, you must manually add a specific tag to the SLB instance before you can rename it. To do so complete the following steps:

Note You can directly rename an SLB instance that you created in CCM of a version later than V1.9.3.10. This is because the system automatically adds a tag to the SLB instance created in these versions of CCM.
  1. Log on to the Master node of the target Kubernetes cluster. For more information, see Connect to a Kubernetes cluster by using kubectl.
  2. Run the # kubectl get svc -n ${namespace} ${service} command to view the IP address of the service provided by the target SLB instance.
    • You must replace ${namespace} and ${service} with the target namespace and service names.
    • The service type is displayed as LoadBalancer.

  3. Run the following command to generate the tag required by the target SLB instance:

    # kubectl get svc -n ${namespace} ${service} -o jsonpath="{.metadata.uid}"|awk -F "-" '{print " "substr("a"$1$2$3$4$5,1,32)}'

  4. Log on to the SLB consoleSLB console. Then, select the corresponding region to which the target SLB instance belongs, and use the IP addressed obtained in step 2 to search for the SLB instance.
  5. Add a tag for the target SLB instance according to the obtained key and its value shown in the preceding figure (in step 3). For more information, see Manage tags.