Problem creating another ingress-nginx/ingress-nginx via helm "Error: rendered manifests contain a resource that already exists"

Viewed 5319

I keep getting this error or variations when I try to do as it asks:

Error: 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 "new-ingress-nginx": current value is "old-ingress-nginx"

I'm using helm to install:

helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update

helm install new-ingress-nginx ingress-nginx/ingress-nginx --set-string controller.podAnnotations."app\.kubernetes\.io/instance"="new"

I've tried with and without the podAnnotations as I found a post mentioning to try that.

I'm using google kubernetes engine and what I have done is merged all my api's under one load balancer/ingress-nginx but I would like to figure out the issue.

1 Answers

I was able to solve my problem after reading through this on github

Some changes were made and --set controller.ingressClassResource.name=<somename> is now used and the yaml file no longer looks like:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: some-ingress
  namespace: somenamespace
  annotations:
    kubernetes.io/ingress.class: <somename>
    ...
spec:
  tls:
  ...

it looks like:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: some-ingress
  namespace: somenamespace
  annotations:
    ...
spec:
  ingressClassName: <somename>
  tls:
  ...
Related