colima: Enabling a `shared` or `bridged` network causes `lima kubectl cluster-info` to fail
Description
colima is unable to verify that the Kubernetes has started correctly when a shared or bridged network is used for the underlying VM.
Version
Colima Version: 0.4.4 Lima Version: 0.11.2 Qemu Version: 7.0.0
Operating System
- macOS Intel
- macOS M1
- Linux
Reproduction Steps
This used to work, but started failing at some point.
I have set up networking for lima as discussed here:
https://github.com/lima-vm/lima/blob/master/docs/network.md
And then in this file: .lima/_config/override.yaml I have this:
networks:
- lima: bridged
When I try to start colima with the network uncommented then I get:
INFO[0000] starting colima
INFO[0000] runtime: containerd+k3s
INFO[0000] preparing network ... context=vm
INFO[0000] starting ... context=vm
INFO[0030] provisioning ... context=containerd
INFO[0030] starting ... context=containerd
INFO[0036] provisioning ... context=kubernetes
INFO[0037] starting ... context=kubernetes
FATA[0062] error starting kubernetes: error running [lima kubectl cluster-info], output: "The connection to the server 127.0.0.1:6443 was refused - did you specify the right host or port?", err: "exit status 1"
Expected behaviour
I would expect the VM to come up with no errors and everything in a useable state.
Additional context
I am able to reproduce this even after recompiling and installing vde-2 and vde_vmnet.
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 2
- Comments: 18 (4 by maintainers)
Yeah, true. It is not expected a user would modify the file directly.
Maybe an introduction of
--network-typeflag (and config) would help with the options beingshared(default) andbridged.It is a misinformation from Colima’s end, it is already corrected in
mainand would be part of the imminent next release.Yep I got exactly the same error when I was trying to start a colima VM with bridged network. Found this issue when I was googling for more information.
It looks like the code is always preparing the vmnet in “shared” mode rather than “bridged”. Finally, after some investigation, I got what I wanted with a local build after patching the code like this:
The patch is definitely hacky thus far from a mature PR. However, I suppose it’s a good start for proof-of-concept and further discussions regarding this feature that some people are looking for 😄 @abiosoft
This is the closest issue I can find related to what I’m trying to achieve setting up a bridged network mode.
I have yet to see how to configure colima to start up the VM using my own network dhcp so I can get a real IP off my network. When I do try to add the network override.yaml for lima, I can start colima fine, but my network override in lima does not setup a bridge the way I’d expect it to.
My override is simple:
Is this even possible? I’ve googled this many times and have found little information on this topic. Any help is much appreciated.