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

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

当我尝试按照它的要求进行操作时,我不断收到此错误或变化:

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"

我正在使用 helm 安装:

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"

我尝试过使用和不使用 podAnnotations,因为我发现 post 提到尝试这样做。

我正在使用 google kubernetes 引擎,我所做的是将我所有的 api 合并到一个负载 balancer/ingress-nginx 下,但我想弄清楚这个问题。

阅读 this on github

后我能够解决我的问题 现在使用

Some changes were made--set controller.ingressClassResource.name=<somename> 并且 yaml 文件不再像:

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

看起来像:

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