-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pod unable to reach itself through a service (unless --cni=true is set) #1568
Comments
It seems it's related to this: kubernetes/kubernetes#19930 and this kubernetes/kubernetes#20475 |
For me, this helped to fix it kubernetes/kubernetes#20475 (comment) So you can do: minikube ssh
sudo ip link set docker0 promisc on Maybe this fix can be merged directly in minikube so people won;t need to do custom things? |
@ursuad It worked for me too (minikube 0.19.1 and k8s v1.6.4). Thanks a lot for your help. :) |
@arrawatia No problem, but maybe you should leave this issue open, so we'll have a longer term fix merged in minkube. |
Not sure if there is a page to capture minikube gotchas. @ursuad's suggestion should be there |
Use Headless Service as a workaround ( |
@kubernetes/sig-minikube |
I'll take a look at this |
@arrawatia can you try with minikube with k8s 1.5.1 I am almost certain it will work in 1.5.1 |
Seeing this issue on minikube 0.21.0 and kube 1.70 and 1.7.2 The workaround posted by @ursuad seems to solve the issue for me |
I'm going to open this up again, since we ended up reverting the kubenet change. |
ref #1742 |
Just updating the status for minikube 0.22.0 - the issue is still present |
Still seeing this in minikube v0.23.0 |
... and v0.24.0... |
... and v0.24.1 |
the same problem here 🤦
|
Fixing this by default appears to incur a ~30% performance penalty for startup, which makes me quite wary of imposing it on the users who do not care about CNI. At a minimum though, we should document that it is possible to now say |
Have tested this with docker driver, running a service of two pods with simple nginx binary. Able to get response using service dns name ..svc.cluster.local from the pods. |
Also tested on kvm driver, doesn't encounter this issue when ping <service_name>..svc.cluster.local. |
./out/minikube start create nginx servicekubectl apply -f template/nginx.yaml ssh into podskubectl get pods kubectl exec -it my-nginx-5b56ccd65f-hpktn -- /bin/bash Welcome to nginx!If you see this page, the nginx web server is successfully installed and working. Further configuration is required. For online documentation and support please refer to
nginx.org. Thank you for using nginx. |
Nginx template: |
thanks @azhao155 for confirming this issue doesnt happen anymore. closing please feel free to re-open if still see this problem |
@belfo : please open a new issue. |
I'm finding @azhao155's test works when the replicas are set to two but the test fails if I run
|
Still seeing this issue on Minikube 1.27 using hyperkit. --cni=true set up the CNI, but still did not allow a Pod to connect to itself through a service. sudo ip link set docker0 promisc in the Minikube VM did fix the behavior. |
Also seeing this on 1.28 with Hyper-V driver. |
Minikube version (use
minikube version
):minikube version: v0.16.0 and k8s version v1.6.4
(But I tried v0.17.1 and v0.19.1 too)
Environment:
Virtualbox
minikube-v1.0.6.iso
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.16.0/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
What happened:
If a pod has a service which points to the pod, the pod cannot reach itself through the service IP. Other pods can reach the service and the pod itself can reach other services. This means all components (especially clustered & distributed systems) which expect to talk to themselves for leader election fail to startup properly.
What you expected to happen:
I expect the pod to be able to reach itself.
How to reproduce it (as minimally and precisely as possible):
It happens with all our services and pods but I can reproduce it with kube-system pods too.
Get service IP :
kubectl describe svc kube-dns --namespace kube-system | grep IP:
. I get10.0.0.10
Get endpoint IP:
kubectl describe svc kube-dns --namespace kube-system | grep Endpoints
. I get172.17.0.3
Exec into the pod:
kubectl --namespace kube-system exec -it kube-dns-v20-54536 sh
Run the following :
Using the service IP hangs
Name: kubernetes-dashboard.kube-system.svc.cluster.local
Address 1: 10.0.0.212 kubernetes-dashboard.kube-system.svc.cluster.local
/ # nslookup kubernetes-dashboard.kube-system.svc.cluster.local 10.0.0.10
Server: 10.0.0.10
^C
Using the endoint IP works
/ # nslookup kubernetes-dashboard.kube-system.svc.cluster.local 172.17.0.3
Server: 172.17.0.3
Address 1: 172.17.0.3 kube-dns-v20-54536
Name: kubernetes-dashboard.kube-system.svc.cluster.local
Address 1: 10.0.0.212 kubernetes-dashboard.kube-system.svc.cluster.local
Accessing a different service IP works. Using the kubernetes-dashboard IP from the last command
/ # telnet 10.0.0.212 80
get
HTTP/1.1 400 Bad Request
Content-Type: text/plain
Connection: close
400 Bad RequestConnection closed by foreign host
Anything else do we need to know:
minikube v0.17.1 works with K8S 1.5.3
I tried the following and it worked. So, I suspect it has something to do with upgrading minikube to v0.17.1 and K8S to v1.6.4
The text was updated successfully, but these errors were encountered: