Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Helm 3 install for resouces that exist

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

like image 724
JDC Avatar asked Dec 22 '19 11:12

JDC


People also ask

How do I install Helm 3 on Kubernetes?

Install Helm 3 From BinaryStep 1: Head over to the Github helm release page and copy the Linux amd64 link for the required version. Step 2: Download the binary using wget. Step 3: Untar the downloaded file. Step 4: Move the helm executable to the bin directory.

Does helm install CRDs?

Helm cannot install the CRD on a dry run, so the discovery client will not know about that Custom Resource (CR), and validation will fail. You can alternatively move the CRDs to their own chart or use helm template instead.

How do I upgrade Helm 2 to 3?

$ helm3 2to3 Migrate and Cleanup Helm v2 configuration and releases in-place to Helm v3 Usage: 2to3 [command] Available Commands: cleanup cleanup Helm v2 configuration, release data and Tiller deployment convert migrate Helm v2 release in-place to Helm v3 help Help about any command move migrate Helm v2 configuration ...


1 Answers

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> 

You can also use --no-hooks to skip running hooks for the command:

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

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

$ 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 - 
like image 191
Kamol Hasan Avatar answered Oct 02 '22 15:10

Kamol Hasan