minikube: Ingress addon: `Error: server.go:84] "failed to process webhook request" err="rejecting admission review because the request does not contain an Ingress resource but networking.k8s.io/v1, Kind=Ingress with name`

Steps to reproduce the issue:

Minikube v1.19.0 docker driver on PopOS 20.10

Using the ingress plugin, installing an ingress always fails.

Exact same steps and yaml works in v1.18.1

Doesn’t matter if the ingress is defined with apiVersion: networking.k8s.io/v1 or apiVersion: extensions/v1beta1 (yaml files used to test each work in v1.18.1)

Suspect that ansible/awx-operator#205 is the same issue.

Failing ingress definition:

- apiVersion: networking.k8s.io/v1
  kind: Ingress
  metadata:
    annotations:
      kubectl.kubernetes.io/last-applied-configuration: |
        {"apiVersion":"networking.k8s.io/v1","kind":"Ingress","metadata":{"annotations":{"kubernetes.io/ingress.global-static-ip-name":"not-used","networking.gke.io/managed-certificates":"not-used"},"labels":{"app":"cwacc-webapp"},"name":"cwacc-webapp","namespace":"gozynta-dev"},"spec":{"rules":[{"host":"cwacc.minikube.local","http":{"paths":[{"backend":{"service":{"name":"cwacc-webapp","port":{"number":5000}}},"path":"/","pathType":"Prefix"}]}}],"tls":[{"hosts":["cwacc.minikube.local"]}]}}
      kubernetes.io/ingress.global-static-ip-name: not-used
      networking.gke.io/managed-certificates: not-used
    labels:
      app: cwacc-webapp
    name: cwacc-webapp
    namespace: gozynta-dev
  spec:
    rules:
    - host: cwacc.minikube.local
      http:
        paths:
        - backend:
            service:
              name: cwacc-webapp
              port:
                number: 5000
          path: /
          pathType: Prefix
    tls:
    - hosts:
      - cwacc.minikube.local
kind: List
metadata: {}

Full output of failed command:

kubectl error: Error from server (InternalError): error when creating "gozynta-dev/profiles/cwacc": Internal error occurred: failed calling webhook "validate.nginx.ingress.kubernetes.io": an error on the server ("") has prevented the request from succeeding

Error in ingress-controller: E0417 00:03:30.320457 7 server.go:84] "failed to process webhook request" err="rejecting admission review because the request does not contain an Ingress resource but networking.k8s.io/v1, Kind=Ingress with name cwacc-webapp in namespace gozynta-dev"

Full output of minikube start command used, if not already included:

πŸ˜„  [cwacc] minikube v1.19.0 on Debian bullseye/sid
✨  Automatically selected the docker driver. Other choices: kvm2, ssh, none
❗  Your cgroup does not allow setting memory.
    β–ͺ More information: https://docs.docker.com/engine/install/linux-postinstall/#your-kernel-does-not-support-cgroup-swap-limit-capabilities
πŸ‘  Starting control plane node cwacc in cluster cwacc
πŸ”₯  Creating docker container (CPUs=3, Memory=4096MB) ...
🐳  Preparing Kubernetes v1.20.2 on Docker 20.10.5 ...
    β–ͺ Generating certificates and keys ...
    β–ͺ Booting up control plane ...
    β–ͺ Configuring RBAC rules ...
πŸ”Ž  Verifying Kubernetes components...
    β–ͺ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟  Enabled addons: storage-provisioner, default-storageclass
πŸ„  Done! kubectl is now configured to use "cwacc" cluster and "default" namespace by default
βœ…  minikube profile was successfully set to cwacc
Switched to context "cwacc".
minikube ssh --profile cwacc sudo sysctl fs.inotify.max_user_watches=1048576
fs.inotify.max_user_watches = 1048576
minikube addons enable ingress --profile cwacc
    β–ͺ Using image docker.io/jettech/kube-webhook-certgen:v1.5.1
    β–ͺ Using image k8s.gcr.io/ingress-nginx/controller:v0.44.0
    β–ͺ Using image docker.io/jettech/kube-webhook-certgen:v1.5.1
πŸ”Ž  Verifying ingress addon...
🌟  The 'ingress' addon is enabled

Optional: Full output of minikube logs command:

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 9
  • Comments: 17 (9 by maintainers)

Most upvoted comments

Same problem on 1.20

[ec2-user@ip-10-4-20-69~]$ minikube version
minikube version: v1.20.0
commit: c61663e942ec43b20e8e70839dcca52e44cd85ae
[ec2-user@ip-10-4-20-69~]$ minikube delete --all --purge
* Deleting "minikube" in docker ...
* Removing /home/ec2-user/.minikube/machines/minikube ...
* Removed all traces of the "minikube" cluster.
* Successfully deleted all profiles
* Successfully purged minikube directory located at - [/home/ec2-user/.minikube]
[ec2-user@ip-10-4-20-69~]$ minikube start
* minikube v1.20.0 on Amazon 2 (xen/amd64)
* Automatically selected the docker driver. Other choices: none, ssh
* Starting control plane node minikube in cluster minikube
* Pulling base image ...
* Downloading Kubernetes v1.20.2 preload ...
    > gcr.io/k8s-minikube/kicbase...: 358.10 MiB / 358.10 MiB  100.00% 41.33 Mi
    > preloaded-images-k8s-v10-v1...: 491.71 MiB / 491.71 MiB  100.00% 73.97 Mi
* Creating docker container (CPUs=2, Memory=4000MB) ...
! This container is having trouble accessing https://k8s.gcr.io
* To pull new external images, you may need to configure a proxy: https://minikube.sigs.k8s.io/docs/reference/networking/proxy/
* Preparing Kubernetes v1.20.2 on Docker 20.10.6 ...
  - Generating certificates and keys ...
  - Booting up control plane ...
  - Configuring RBAC rules ...
* Verifying Kubernetes components...
  - Using image gcr.io/k8s-minikube/storage-provisioner:v5
* Enabled addons: storage-provisioner, default-storageclass
* kubectl not found. If you need it, try: 'minikube kubectl -- get pods -A'
* Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
[ec2-user@ip-10-4-20-69~]$ minikube addons enable ingress
  - Using image docker.io/jettech/kube-webhook-certgen:v1.5.1
  - Using image k8s.gcr.io/ingress-nginx/controller:v0.44.0
  - Using image docker.io/jettech/kube-webhook-certgen:v1.5.1
* Verifying ingress addon...

X Exiting due to MK_ENABLE: run callbacks: running callbacks: [waiting for app.kubernetes.io/name=ingress-nginx pods: timed out waiting for the condition]

Confirm, disabling the Minikube ingress addon and using the ingress-nginx helm chart from Artifact Hub fixes this. For both the Ingress and LoadBalancer to get an IP address, I have to minikube tunnel. But avoiding this was my motivation for trying ingress-nginx, so this isn’t ideal.

Same exact failure on macos 11.2.3 with virtualbox dirver as well