<p>We created a kubernetes cluster for a customer about one year ago with two environments; staging and production separated in namespaces. We are currently developing the next version of the application and need an environment for this development work, so we've created a beta environment in its own namespace.</p>

<p>This is a bare metal kubernetes cluster with MetalLB and and nginx-ingress. The nginx ingress controllers is installed with helm and the ingresses are created with the following manifest (namespaces are enforced by our deployment pipeline and are not visible in the manifest):</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: api-ingress
  annotations:
    #ingress.kubernetes.io/ssl-redirect: "true"
    #kubernetes.io/tls-acme: "true"
    #certmanager.k8s.io/issuer: "letsencrypt-staging"
    #certmanager.k8s.io/acme-challenge-type: http01
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/configuration-snippet: |
      more_set_headers "X-Robots-Tag: noindex, nofollow";
    nginx.ingress.kubernetes.io/enable-cors: "true"
    nginx.ingress.kubernetes.io/cors-allow-methods: "GET, OPTIONS"
    nginx.ingress.kubernetes.io/cors-allow-origin: "*"
    nginx.ingress.kubernetes.io/cors-allow-credentials: "true"
spec:
  tls:
    - hosts:
        - ${API_DOMAIN}
      secretName: api-cert
  rules:
    - host: ${API_DOMAIN}
      http:
        paths:
          - backend:
              serviceName: api
              servicePort: 80
</code></pre>

<p>When applying the manifest kubernetes responds with the following error:</p>

<blockquote>
  <p>Error from server (InternalError): error when creating "STDIN": Internal error occurred: failed calling webhook "validate.nginx.ingress.kubernetes.io": Post <a href="https://ingress-nginx-controller-admission.ingress-nginx.svc:443/extensions/v1beta1/ingresses?timeout=30s" rel="noreferrer">https://ingress-nginx-controller-admission.ingress-nginx.svc:443/extensions/v1beta1/ingresses?timeout=30s</a>: service "ingress-nginx-controller-admission" not found</p>
</blockquote>

<p>I've attempted to update the apiVersion of the ingress manifest to <code>networking.k8s.io/v1beta1</code> (this is the apiVersion the new nginx-ingress controllers are installed with via helm), but I'm getting the same error.</p>

<p>My initial suspicion is that this is related to a change in the nginx-ingress between the current installation and the installation from one year ago, even if the ingress controllers are separated by namespaces. But i cant find any services called <code>ingress-nginx-controller-admission</code> in any of my namespaces, so I'm clueless how to proceed.</p>

<p>I had the same problem and found a solution from another <a href="https://stackoverflow.com/a/61681896/2286960">SO thread</a>.</p>

<p>I had previously installed nginx-ingress using the manifests. I deleted the namespace it created, and the <a href="https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-manifests/#uninstall-the-ingress-controller" rel="noreferrer">clusterrole and clusterrolebinding as noted in the documentation</a>, but that does not remove the <code>ValidatingWebhookConfiguration</code> that is installed in the manifests, but NOT when using helm by default. As <a href="https://stackoverflow.com/users/1839482/arghya-sadhu">Arghya</a> noted above, it can be enabled using a helm parameter.</p>

<p>Once I deleted the <code>ValidatingWebhookConfiguration</code>, my helm installation went flawlessly.</p>

<pre><code>kubectl delete -A ValidatingWebhookConfiguration ingress-nginx-admission
</code></pre>
