Helm 3 install for resouces that exist

12/22/2019

when running helm install (helm 3.0.2)

I got the following error: Error: rendered manifests contain a resource that already exists. Unable to continue with install: existing resource conflict: kind: PodSecurityPolicy, namespace: , name: po-kube-state-metrics

But I don't find it and also In the error im not getting the ns, How can I remove it ?

when running kubectl get all --all-namespaces I see all the resources but not the po-kub-state-metrics ... it also happen to other resources, any idea?

I got the same error to: monitoring-grafana entity and the result of kubectl get PodSecurityPolicy --all-namespaces is:

monitoring-grafana false RunAsAny RunAsAny RunAsAny RunAsAny false configMap,emptyDir,projected,secret,do

-- Jhon D
kubernetes
kubernetes-helm

3 Answers

2/8/2020

for my case able to successfully upgrade my build with --force

Mulhasans-MacBook-Pro:helm-tuts mulhasan$ helm upgrade --install --force  api-streamingserver ./api-streamingserver

This will help for the same Release if you are doing with different release choose a different name for conflicting resources as of now Helmv3.x doesn't have option for CRDs --skip-crds is removed in Helmv3.x

-- Mansur Ali
Source: StackOverflow

12/23/2019

First of all you need to make sure you've successfully uninstalled the helm release, before reinstalling.

To list all the releases, use:

$ helm list --all --all-namespaces

To uninstall a release, use:

$ helm uninstall <release-name> -n <namespace>

If uninstalling doesn't solve your problem, you can you try the following command to clean up:

$ helm template <NAME> <CHART> --namespace <NAMESPACE> | kubectl delete -f - 

Sample:

$ helm template happy-panda stable/mariadb --namespace kube-system | kubectl delete -f -

Now, try installing again.

Update:

Let's consider that your chart name is mon and your release name is po. Since you are in the charts directory (.) like below:

.
├── mon
│   ├── Chart.yaml
│   ├── README.md
│   ├── templates
│   │   ├── one.yaml
│   │   ├── two.yaml
│   │   ├── three.yaml
│   │   ├── _helpers.tpl
│   │   ├── NOTES.txt
│   └── values.yaml

Then you can skip the helm repo name (i.e. stable) in the helm template command. Helm will use your mon chart from the directory.

$ helm template po mon --namespace mon | kubectl delete -f -
-- Kamol Hasan
Source: StackOverflow

12/30/2019

I had the same error with CRDs objects. I used this chart on Github, and to prevent this error I used the --skip-crds flag. Maybe the project that you are using has something like this: https://github.com/helm/charts/tree/master/incubator/sparkoperator#configuration

-- Daniel Marques
Source: StackOverflow