colima icon indicating copy to clipboard operation
colima copied to clipboard

Error with kubectl when running with --network-address

Open faisal-memon opened this issue 6 months ago • 7 comments

Description

I start colima like this: colima start --with-kubernetes --memory 8 --network-address

and then run kubectl and get this error:

$ kubectl get pods
E0626 12:45:47.674178   28658 memcache.go:265] "Unhandled Error" err="couldn't get current server API group list: Get \"https://192.168.64.2:50599/api?timeout=32s\": dial tcp 192.168.64.2:50599: connect: no route to host"
E0626 12:45:47.675852   28658 memcache.go:265] "Unhandled Error" err="couldn't get current server API group list: Get \"https://192.168.64.2:50599/api?timeout=32s\": dial tcp 192.168.64.2:50599: connect: no route to host"
E0626 12:45:47.677138   28658 memcache.go:265] "Unhandled Error" err="couldn't get current server API group list: Get \"https://192.168.64.2:50599/api?timeout=32s\": dial tcp 192.168.64.2:50599: connect: no route to host"
E0626 12:45:47.678439   28658 memcache.go:265] "Unhandled Error" err="couldn't get current server API group list: Get \"https://192.168.64.2:50599/api?timeout=32s\": dial tcp 192.168.64.2:50599: connect: no route to host"
E0626 12:45:47.679678   28658 memcache.go:265] "Unhandled Error" err="couldn't get current server API group list: Get \"https://192.168.64.2:50599/api?timeout=32s\": dial tcp 192.168.64.2:50599: connect: no route to host"
Unable to connect to the server: dial tcp 192.168.64.2:50599: connect: no route to host

In ~/.kube/config i changed the server address from routable ip to local and then it seems like everything is working ok: server: https://192.168.64.2:50599 -> server https://127.0.0.1:50599

Version

$ colima version
colima version 0.8.1
git commit: 96598cc5b64e5e9e1e64891642b91edc8ac49d16

runtime: docker
arch: aarch64
client: v28.1.1
server: v27.4.0

Operating System

  • [ ] macOS Intel <= 13 (Ventura)
  • [ ] macOS Intel >= 14 (Sonoma)
  • [ ] Apple Silicon <= 13 (Ventura)
  • [x] Apple Silicon >= 14 (Sonoma)
  • [ ] Linux

Output of colima status

$ colima status
INFO[0002] colima is running using macOS Virtualization.Framework
INFO[0002] arch: aarch64
INFO[0002] runtime: docker
INFO[0002] mountType: sshfs
INFO[0002] address: 192.168.64.2
INFO[0002] socket: unix:///Users/faisalmemon/.colima/default/docker.sock
INFO[0002] kubernetes: enabled

Reproduction Steps

  1. colima start --with-kubernetes --memory 8 --network-address
  2. kubectl get pods

Expected behaviour

See pods

Additional context

Error from kubectl

faisal-memon avatar Jun 27 '25 15:06 faisal-memon

I started getting this from about 3 months ago also, and gave up on fixes.

I tried: reset all networking, changed the Virtualization framework subnet, removed all DHCP.

Weirdly, no Python softwares can reach it either, but libcurl can? curl -kv https://192.168.106.3:49357/api works. So it doesn't seem like macOS/Colima is actually producing a bad routing table.

tysoekong avatar Jul 02 '25 20:07 tysoekong

Unfortunately, I am not able to reproduce this.

abiosoft avatar Jul 31 '25 15:07 abiosoft

@abiosoft

Yeah I know it's really bizarre, if I just go and edit kubeconfig and change to https://127.0.0.1:49336 as the target address, it works fine.

I don't know what golang / kubesigs / whatever TCPIP stack is doing to pick the wrong route every time, but it only happens like 50% of Colima startups.

I think the fix is just set localhost as your cluster address in kubeconfig.

tysoekong avatar Jul 31 '25 16:07 tysoekong

same here

john@MacBook-Pro-von-John-Paul src % colima --version colima version 0.8.2 john@MacBook-Pro-von-John-Paul src % sw_vers ProductName: macOS ProductVersion: 15.5 BuildVersion: 24F74 john@MacBook-Pro-von-John-Paul src % colima status INFO[0000] colima is running using macOS Virtualization.Framework INFO[0000] arch: aarch64 INFO[0000] runtime: docker INFO[0000] mountType: virtiofs INFO[0000] address: 192.168.65.2 INFO[0000] socket: unix:///Users/john/.colima/default/docker.sock john@MacBook-Pro-von-John-Paul src % ping 192.168.65.2 PING 192.168.65.2 (192.168.65.2): 56 data bytes ping: sendto: No route to host ping: sendto: No route to host Request timeout for icmp_seq 0 ping: sendto: No route to host Request timeout for icmp_seq 1

ambition-consulting avatar Aug 03 '25 09:08 ambition-consulting

Experiencing the exact same problem, arm64/M1, MacOS 15.7.1 (24G231), colima version 0.9.1.

perezd avatar Nov 05 '25 00:11 perezd

A colleague is seeing this as well, with 0.9.1. Trying the bridged network mode doesn't help either.

glasser avatar Nov 19 '25 21:11 glasser

A colleague is seeing this as well, with 0.9.1. Trying the bridged network mode doesn't help either.

Mine started working, and I think it was doing a fresh install of colima after a reboot. I'd give that a try and report back.

perezd avatar Nov 19 '25 21:11 perezd