Erro com Helm

Eu tentando a fazer a instalação do chart do NGINX no Helm com o seguinte comando:

$  helm install my-ingress ingress-nginx/ingress-nginx

me retorna este erro :ambulance: :

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: missing key "meta.helm.sh/release-name": must be set to "my-ingress"; 
annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "default"

O Helm está informando que já existe um recurso de nginx instalado no meu namespace.

A gente precisa então verificar onde estaria esta ingressClass utilizando o kubectl get:

$  kubectl get ingressClass -A

que me retornou a seguinte informação:

NAME    CONTROLLER             PARAMETERS   AGE
nginx   k8s.io/ingress-nginx   none       43h

Note que é a classe que está impedindo a instalação do helm chart do ingress!!!

Preciso então deletar, para que possa prosseguir:

$  kubectl delete ingressClass nginx -A

e então rodamos:

$  helm install my-ingress ingress-nginx/ingress-nginx

que irá retornar:

NAME: meu-ingress
LAST DEPLOYED: Wed Nov  3 17:54:54 2021
NAMESPACE: nginx-ingress
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
The ingress-nginx controller has been installed.
It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status by running 'kubectl --namespace nginx-ingress get services -o wide -w meu-ingress-ingress-nginx-controller'

An example Ingress that makes use of the controller:

  apiVersion: networking.k8s.io/v1
  kind: Ingress
  metadata:
    annotations:
      kubernetes.io/ingress.class: nginx
    name: example
    namespace: foo
  spec:
    ingressClassName: example-class
    rules:
      - host: www.example.com
        http:
          paths:
            - path: /
              pathType: Prefix
              backend:
                service:
                  name: exampleService
                  port: 80
    # This section is only required if TLS is to be enabled for the Ingress
    tls:
      - hosts:
        - www.example.com
        secretName: example-tls

If TLS is enabled for the Ingress, a Secret containing the certificate and key must also be provided:

  apiVersion: v1
  kind: Secret
  metadata:
    name: example-tls
    namespace: foo
  data:
    tls.crt: <base64 encoded cert>
    tls.key: <base64 encoded key>
  type: kubernetes.io/tls

Pronto instalado com sucesso :raised_hands: !!!

Qualquer dúvida postem nos comentários !!!! :loudspeaker: