kubernetes / minikube

Run Kubernetes locally
https://minikube.sigs.k8s.io/
Apache License 2.0
29.54k stars 4.89k forks source link

minikube ip is not pingable #18747

Open jlim0930 opened 7 months ago

jlim0930 commented 7 months ago

What Happened?

macOS 14.4
docker 23.0.5
minikube version v1.33.0

After starting minikube with minikube start --driver docker the environment is stood up however I am unable to ping the minikube ip

~ ping `minikube ip`
PING 192.168.49.2 (192.168.49.2): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
^C
--- 192.168.49.2 ping statistics ---
3 packets transmitted, 0 packets received, 100.0% packet loss

In my docker settings I have

image

I tried to also start minikube with minikube start --driver docker --static-ip 192.168.65.49 and now getting

Preparing Kubernetes v1.30.0 on Docker 26.0.1 ...- E0424 16:16:57.878670   96617 start.go:131] Unable to get host IP: resolve dns to ip: docker exec -t minikube dig +short host.docker.internal: exit status 9
stdout:
;; communications error to 192.168.65.1#53: timed out
;; communications error to 192.168.65.1#53: timed out
;; communications error to 192.168.65.1#53: timed out
;; no servers could be reached

and once minikube is started it shows

~ minikube ip
192.168.65.49
~ ping `minikube ip`
PING 192.168.65.49 (192.168.65.49): 56 data bytes
Request timeout for icmp_seq 0
^C
--- 192.168.65.49 ping statistics ---
2 packets transmitted, 0 packets received, 100.0% packet loss

On my linux host I am able to ping the minikube ip without issues

Attach the log file

with --static-ip 192.168.65.49 log.txt

without --static-ip 192.168.65.49 log2.txt

Operating System

macOS (Default)

Driver

Docker

saurabhbhalla90 commented 6 months ago

I have the exact same issue.

PiotrKalinski commented 5 months ago

Having same issue on macOS, fresh minikube.

conradwt commented 5 months ago

I'm having the same issue with Minikube using a newly created cluster.

martin-hrosovsky commented 3 months ago

Same problem here

basahota commented 3 months ago

I am also having same issue and struggling to resolve it from past 2 days but no luck , does it work for anyone please update the thread

basahota commented 3 months ago

try choosing different driver instead of docker it should work , its working for me now


❯ 
❯ minikube delete
πŸ”₯  Deleting "minikube" in docker ...
πŸ”₯  Deleting container "minikube" ...
πŸ”₯  Removing /Users/javatechie/.minikube/machines/minikube ...
πŸ’€  Removed all traces of the "minikube" cluster.
❯ minikube start --driver=hyperkit

πŸ˜„  minikube v1.33.0 on Darwin 13.6.9
✨  Using the hyperkit driver based on user configuration
πŸ’Ύ  Downloading driver docker-machine-driver-hyperkit:
    > docker-machine-driver-hyper...:  65 B / 65 B [---------] 100.00% ? p/s 0s
    > docker-machine-driver-hyper...:  9.43 MiB / 9.43 MiB  100.00% 1.81 MiB p/
πŸ”‘  The 'hyperkit' driver requires elevated permissions. The following commands will be executed:

    $ sudo chown root:wheel /Users/javatechie/.minikube/bin/docker-machine-driver-hyperkit 
    $ sudo chmod u+s /Users/javatechie/.minikube/bin/docker-machine-driver-hyperkit 

Password:
πŸ’Ώ  Downloading VM boot image ...
    > minikube-v1.33.0-amd64.iso....:  65 B / 65 B [---------] 100.00% ? p/s 0s
    > minikube-v1.33.0-amd64.iso:  314.16 MiB / 314.16 MiB  100.00% 12.80 MiB p
πŸ‘  Starting "minikube" primary control-plane node in "minikube" cluster
πŸ”₯  Creating hyperkit VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
🐳  Preparing Kubernetes v1.30.0 on Docker 26.0.1 ...
    β–ͺ Generating certificates and keys ...
    β–ͺ Booting up control plane ...
    β–ͺ Configuring RBAC rules ...
πŸ”—  Configuring bridge CNI (Container Networking Interface) ...
πŸ”Ž  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 "minikube" cluster and "default" namespace by default
❯ minikube status
minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured

❯ minikube ip
192.168.64.28
❯ ping 192.168.64.28
PING 192.168.64.28 (192.168.64.28): 56 data bytes
64 bytes from 192.168.64.28: icmp_seq=0 ttl=64 time=0.316 ms
64 bytes from 192.168.64.28: icmp_seq=1 ttl=64 time=0.289 ms
64 bytes from 192.168.64.28: icmp_seq=2 ttl=64 time=0.305 ms
64 bytes from 192.168.64.28: icmp_seq=3 ttl=64 time=0.278 ms
64 bytes from 192.168.64.28: icmp_seq=4 ttl=64 time=0.273 ms
64 bytes from 192.168.64.28: icmp_seq=5 ttl=64 time=0.286 ms
64 bytes from 192.168.64.28: icmp_seq=6 ttl=64 time=0.272 ms
64 bytes from 192.168.64.28: icmp_seq=7 ttl=64 time=0.266 ms
64 bytes from 192.168.64.28: icmp_seq=8 ttl=64 time=0.282 ms
64 bytes from 192.168.64.28: icmp_seq=9 ttl=64 time=0.236 ms
^C
--- 192.168.64.28 ping statistics ---
10 packets transmitted, 10 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.236/0.280/0.316/0.021 ms
afbjorklund commented 3 months ago

Why do you need ICMP?

The Docker Desktop networking has some issues, like not being accessible from the host...

https://docs.docker.com/desktop/networking/#per-container-ip-addressing-is-not-possible

Minikube has "tunnel"

k8s-triage-robot commented 2 days ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale