Closed iamnoah closed 3 years ago
Also, downgrading to 1.22 resolves the issue for us.
Seems to be a service account issue:
E0908 00:05:23.074631 8 leaderelection.go:361] Failed to update lock: configmaps "ingress-controller-leader" is forbidden: User "system:serviceaccount:ingress-nginx:ingress-nginx" cannot update resource "configmaps" in API group "" in the namespace "ingress-nginx"
This is also happening under Linux (Fedora) with the Docker engine. Edit: with regular ingress
.
minikube version: v1.23.0
$ minikube start --vm-driver=virtualbox --memory=8192 --cpus=2 --addons=ingress
Arch Linux, not working
The ingress-dns issue has to do with the source code of the docker image the addon is using. It's calling an old endpoint for ingresses that was fully deprecated in 1.22, which is causing the pod to crash anytime the nslookup is done.
I'm building/pushing a new image with the proper endpoint here soon and the fix will be live in the 1.23.1 release happening this week.
Hi @sharifelgamal I tried the initial steps to reproduce that issue.
I also upgraded Minikube to version
β― minikube version
minikube version: v1.24.0
commit: 76b94fb3c4e8ac5062daf70d60cf03ddcc0a741b
β― docker -v
Docker version 20.10.8, build 3967b7d
I also tried to run minikube tunnel
in a seperate window.
I also tried also another Kubernetes version (which I normally use and need):
minikube start --memory=4096 --driver=docker --kubernetes-version=v1.21.6 --cpus=4
And that's the content of my /private/etc/resolver/minikube file:
domain test
nameserver 192.168.49.2
search_order 1
timeout 5
NAMESPACE NAME CLASS HOSTS ADDRESS PORTS AGE
kube-system example-ingress nginx hello-john.test,hello-jane.test localhost 80 6m1s
But tests against that domain are still failing. Why and how to bypass that?
β― nslookup hello-john.test $(minikube ip)
;; connection timed out; no servers could be reached
Maybe out of scope: has addons ingress
also to be enabled? or is addons ingress-dns
enough? Bit lost there.
Any suggestion could safe my weekend :-)
here are my minikube logs
:
Since this seems like a common problem, I'll go ahead and explain what's happening for MacOS M1 users
the output of $(minikube ip)
is the IP address of the minikube container in docker. The host OS has no access to the containers via their IP addresses (unless otherwise is specified, which happens to be unsupported on MacOS), which is why you often see that people solve the issue by changing the driver (a note to make here is that hyperkit
is not supported on M1), so that in the end the IP address of minikube is available to the host.
You can validate this as follows:
$ docker ps | grep minikube # get the minikube container
4384aae94e95 kicbase/stable:v0.0.42 "/usr/local/bin/entrβ¦" 2 weeks ago Up About an hour 127.0.0.1:50144->22/tcp, 127.0.0.1:50145->2376/tcp, 127.0.0.1:50147->5000/tcp, 127.0.0.1:50143->8443/tcp, 127.0.0.1:50146->32443/tcp
$ minikube ip
192.168.49.2
$ docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' minikube
192.168.49.2 # sounds about right
$ curl -k https://192.168.49.2:8443 # does not work with internal ip
# timeout
$ curl -k https://127.0.0.1:50143/ # works with exposed port (scroll to the right for `docker ps` output)
{
"kind": "Status",
"apiVersion": "v1",
"metadata": {},
"status": "Failure",
"message": "forbidden: User \"system:anonymous\" cannot get path \"/\"",
"reason": "Forbidden",
"details": {},
"code": 403
}
The solution would be to use a tool like docker-mac-net-connect.
If you don't want to, you can just update your /etc/hosts
to include this line 127.0.0.1 localhost,minikube.test
and then you can use minikube.test
as the ingress host
. But you would need to run minikube tunnel
every time. It's not a big deal if you do it for one host, but if the number of unique hosts increase, then it's a DNS pollution problem. Here's a GitHub issue link if this is still unclear.
For more about DNS, see how docker implements their DNS resolution
For me docker-mac-net-connect worked very well as @usersina said. My system spec is like this.
MacBook Pro 16 (2021)
Apple M1 Max
...
minikube version : v1.27.1
Docker Desktop version : v4.28.0
Just one thing to mention, I had to reinstall Docker for applying the solution. Reinstall is explained at Troubleshooting section and running the solution not as service but directly to see the logs really helped me.
+1 Thanks @usersina Just installing docker-mac-net-connect on my M1 mac fixed the issue
+1 Thanks @usersina Just installing docker-mac-net-connect on my M1 mac fixed the issue
Sorry, after installing docker-mac-net-connect, what are we gonna do next? I just installed and followed the official tutorial but still cannot use ingress-dns.
+1 Thanks @usersina Just installing docker-mac-net-connect on my M1 mac fixed the issue
Sorry, after installing docker-mac-net-connect, what are we gonna do next? I just installed and followed the official tutorial but still cannot use ingress-dns.
This worked for me (using a ".test" domain on my local machine to resolve ingress resources):
$ minikube addons enable ingress
$ minikube addons enable ingress-dns
$ brew install chipmk/tap/docker-mac-net-connect
$ sudo brew services start chipmk/tap/docker-mac-net-connect
$ cat <<EOF | sudo tee /etc/resolver/minikube-test
domain test
nameserver $(minikube ip)
search_order 1
timeout 5
EOF
Check that the resolver shows up in the output of scutil --dns
Then I set the output of minikube ip
to be a DNS nameserver in the WiFi settings too
$ nslookup hello-world.test $(minikube ip) # hello-world.test is an ingress endpoint in my cluster
<the same as `minikube ip`>
MacOS BigSur 11.5.2
Following the ingress-dns setup.
Steps to reproduce the issue:
minikube start --vm=true
tried with and without --vm=trueThen verification:
lsof
shows nothing is listening on port 53:logs.txt