What Should I Do If a Chart Creation or Upgrade Fails and "rendered manifests contain a resource that already exists" Is Displayed?
Symptom
When a chart cannot be created or upgraded, the error message "Create release by helm failed: rendered manifests contain a resource that already exists. Unable to continue with install: ..." is displayed.
CCE add-ons are installed using charts. The same error may occur when an add-on is installed or upgraded.
Possible Cause
This error message indicates that there are some residual resources related to the chart or add-on in the cluster. The possible causes are as follows:
- Chart resources (such as releases) were mistakenly or abnormally deleted in the backend.
- The namespace installed using the chart was directly deleted, leaving residual resources.
- A resource with the same name as a chart component exists in the cluster but lacks the app.kubernetes.io/managed-by: Helm label.
Solution
Access the cluster using kubectl, manually delete the resources associated with the error, and reinstall the chart or add-on.
- Check the error message to identify the resource causing the conflict. Pay attention to the information after "Unable to continue with install:".
For example:
create release failed: create release failed {"error":{"message":"Create release by helm failed:rendered manifests contain a resource that already exists. Unable to continue with install: ClusterRole \"cceaddon-nginx-ingress\" in namespace \"\" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key \"meta.helm.sh/release-namespace\" must equal \"kube-system\": current value is \"example\"","code":"SVCSTG.CCECAM.5000208"}}
- Conflicting resource: ClusterRole named cceaddon-nginx-ingress, which does not belong to any namespace (ClusterRoles are not namespace-level resources.)
- Conflicting field: metadata.annotations.meta.helm.sh/release-namespace
- Expected value: kube-system
- Actual value: example
- Run the following kubectl command to delete the conflicting resource in the cluster: (The command here is only an example. Delete the resources based on the error message.)
kubectl delete clusterRole cceaddon-nginx-ingress
- After the resource conflict is resolved, reinstall the chart or add-on. If the conflict message reappears, repeat the process.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot