Helm and Ingress

Whenever I try to install a depdency in my helm chart like this,

dependencies:
  - name: "ingress-nginx"
    repository: https://kubernetes.github.io/ingress-nginx
    version: 4.x.x

I get some variant of this error,

Error: INSTALLATION FAILED: rendered manifests contain a resource that already exists. Unable to continue with install: IngressClass “nginx” in namespace “” exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key “meta.helm.sh/release-name” must equal “acme-1681915764”: current value is “scorp-nginx”; annotation validation error: key “meta.helm.sh/release-namespace” must equal “acmens”: current value is “default”

I don’t have access to IngressClass “nginx” in the default namespace. I’ve tried all kinds of things to

Cluster information:

Client Version: version.Info{Major:“1”, Minor:“24+”, GitVersion:“v1.24.12-dispatcher”, GitCommit:“16927ebb4e9056330d797f5b7a2051ba73af1200”, GitTreeState:“clean”, BuildDate:“2023-03-19T06:16:28Z”, GoVersion:“go1.19.7”, Compiler:“gc”, Platform:“linux/arm64”}
Kustomize Version: v4.5.4
Server Version: version.Info{Major:“1”, Minor:“24”, GitVersion:“v1.24.10-gke.2300”, GitCommit:“1d7ae0799b40b0cd95502e3a5e698db62572e341”, GitTreeState:“clean”, BuildDate:“2023-02-22T09:28:49Z”, GoVersion:“go1.19.6 X:boringcrypto”, Compiler:“gc”, Platform:“linux/amd64”}

This error occurs because there is an existing resource (IngressClass “nginx”) in the default namespace that has conflicting ownership metadata with the current release. Outsourcing companies can be a good option for solving various problems like this

Yes, this is a known “issue” (depending on the point of view :wink: )
If there’s been an ingress controler with the same name before - even if you’ve already deleted it - the ingressclasses might still be there as they’re not dumped automatically

So firstly check if they’re still present:
kubectl describe ingressclasses

… if so, delete 'em
kubectl delete ingressclasses <CLASS>

Right, but the question is why is importing this thing that exists. I want to create something else, a new ingress controller entirely… Why would it import this one.