Cette page n'est pas encore disponible dans votre langue. Nous nous efforçons d'ajouter d'autres langues. Nous vous remercions de votre compréhension.
- What's New
- Service Overview
- Getting Started
- User Guide
- Best Practices
-
FAQs
- Service Mesh Cluster
- Mesh Management
-
Adding a Service
- What Do I Do If an Added Gateway Does Not Take Effect?
- Why Does It Take a Long Time to Start the Demo Application in Experiencing Service Mesh in One Click?
- Why Can't I Access the page of the Demo Application After It Is Successfully Deployed?
- Why Cannot I Select the Corresponding Service When Adding a Route?
- Performing Grayscale Release
- Videos
Show all
All Pods Have the app and version Labels
Description
All pods of a Service must be labeled with app and version. app traces traffic in traffic monitoring, and version distinguishes different versions in grayscale release. If a pod is not labeled with app or version, this item is abnormal.
Rectification Guide
The labels of pods are configured in spec.template.metadata.labels of the Deployment. The recommended configuration is as follows:
labels: app: {serviceName} version: v1
Modifying or deleting the Deployment will trigger pod rolling upgrade, which may cause temporary service interruption. Therefore, perform the operation at a proper time.
- Copy the original workload configuration and save it as a YAML file.
kubectl get deployment {deploymentName} -n {namespace} -o yaml > {deploymentName}-deployment.yaml
For example:
kubectl get deployment productpage -n default -o yaml > productpage-deployment.yaml
- Modify the productpage-deployment.yaml file. If the file does not contain app and version, add them. You are advised to set app to the Service name and the version to v1.
- Delete the original workload.
kubectl delete deployment {oldDeploymentName} -n {namespace}
- Apply the new workload configuration.
kubectl apply -f productpage-deployment.yaml
For clusters of v1.15 or earlier, you can modify pod labels on the CCE console, but residual ReplicaSets may exist.
To check whether there are residual ReplicaSets, perform the following steps:
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.