Stil, the ingress-nginx-controller pod keeps failing (CrashLoopBackOff) with the following errors in the log:
E1223 19:55:43.445636 7 reflector.go:138] k8s.io/client-go@v0.20.2/tools/cache/reflector.go:167: Failed to watch *v1beta1.Ingress: failed to list *v1beta1.Ingress: the server could not find the requested resource
Any ideas what could be the cause? Any good examples/instructions on how to setup ingress-nginx in Docker Desktop?
Does it work in Rancher Desktop using the same Kubernetes version? I think it is more likely to be a Kubernetes and Nginx controller issue since there are mny other reports online not related to Docker Desktop, but I will try that yaml
update:
As I thought. It works with the nginx ingress v1.5.1 which is the latest version of the nginx controller. So the latest Kubernetes version is not compatible with the old nginx controller, since the API has changed since then.
Thank you @rimelek
I tried with v 1.5.1 and now the ingress-nginx-controller pod starts fine. But when I deploy my application, I see it created an ingress in the default namespace. But I cannot access it from the desktop (http://my-applicaion.localhost)
I noticed that when ‘kubectl describe ingress my-application’ it shows Ingress Class ‘none’ not sure if this matter. but shows the configured host, paths, backend, etc.
This is on my Windows desktop. I have mappings in the ‘hosts’ file like : “127.0.0.1 my-aaplication.localhost”
I only have one pod in the default namespace. I tried to access it from one of the kube-system pods with “http://my-application” which did not work, but accessing the endpoint IP address (taken from describe ingress) worked from the other pod.
I wouldn’t have expected it to work, but I tried on mac and test.localhost was actually resolved in containers, but that would not work without Docker Desktop. Although it works with Docker Desktop, that resolves the domain to a loopback address which will point to the loopback ip address of the container that is trying to send the request. You need to set the IP address to the IP of your host and not 127.0.0.1
This is why I asked if the request was sent on client side, becuse that (for example javascript on a website) runs on the host which can see the loopback ip address of the host.
I think both addresses should work. I believe in previous versions (as well for Rancher) docker listened on 127.0.0.1:80/443. Now I see it listening on 0.0.0.0:80/443.
I also believe that I did not restart docker desktop after installing the inginx ingress controller. Because once I did, I now get a “404 Not Found” error from nginx when I hit http(s)://my-applicaion.localhost from my windows browser.
Trying to figure out where the problem lies, I applied a yaml file including the ingress definition of my-other-application (yet to be deployed). When I hit http(s)://my-other-application I get “503 Service Temporarily Unavialable”, comparing the two ingress manifests I found I was missing annotation: “kubernetes.io/ingress.class: nginx” in my-application’s ingress definition, I was able to http into my application once I added the missing annotation and re-deployed the Ingress definition
Much thanks for your help @rimelek (Ákos).