-
-
Notifications
You must be signed in to change notification settings - Fork 466
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
[BUG] error adding hosts file entry for <nil>:[host.k3d.internal]: "<nil>" is an invalid IP address #1018
Comments
It looks like |
Hi @ololobus , thanks for opening this issue! |
I am seeing the same issue with 5.3.0 (not observed in 5.2.2). I setup the network via a docker cli command:
My k3d config uses values in that IP range for cluster cidr, service cidr, and cluster dns (in addition to |
@iwilltry42, it seems it has, here is an output of [
{
"Name": "zenith_net",
"Id": "3c4221a7591171eb42dde89802e1ea13945daf1a1443039eddc9a166cfa2c467",
"Created": "2022-03-16T18:29:42.962296627+03:00",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.20.42.0/24",
"Gateway": "172.20.42.1"
}
]
},
"Internal": false,
"Attachable": true,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"6ee06f6c34f22f504c45d15dbebaa7c85256425bba760a7abd0f9d46a443c82b": {
"Name": "young-forest-671487",
"EndpointID": "d709edd51058e1fff125d3affcd5c72d1e8e5fb7a410135e70e2f18be7ec4553",
"MacAddress": "02:42:ac:14:2a:04",
"IPv4Address": "172.20.42.4/24",
"IPv6Address": ""
},
"b4d0bcd4f3c7c455880bb0f4b35903e3a3f90898a4d1b1228966077043f273bf": {
"Name": "royal-bread-675489",
"EndpointID": "9380eb4de34b963aba754fec6df3ca63cbc221345ac9d852339d4428d63bcbef",
"MacAddress": "02:42:ac:14:2a:02",
"IPv4Address": "172.20.42.2/24",
"IPv6Address": ""
},
"e75f9e40f5242447ba30ae2edc832480337cf126ce4439bb6fd29496d59d16fb": {
"Name": "misty-block-624433",
"EndpointID": "7f3623d90beb838ef6ee15db457701639966057cb0b31208fb036ef7d9538a99",
"MacAddress": "02:42:ac:14:2a:03",
"IPv4Address": "172.20.42.3/24",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {
"com.docker.compose.network": "zenith_net",
"com.docker.compose.project": "console",
"com.docker.compose.version": "1.27.4"
}
}
] |
This is weird.. I just tried your commands and in fact in my setup, the gateway is missing 🤔 $ docker network create foonet --driver=bridge -o "com.docker.network.driver.mtu"="1450" --subnet=172.20.0.0/16
ab0aac890c2fd5ec4c41ea64c73305dfdf5e5a7ea752e8e15bd671ce503b0587
$ docker network inspect foonet
[
{
"Name": "foonet",
"Id": "ab0aac890c2fd5ec4c41ea64c73305dfdf5e5a7ea752e8e15bd671ce503b0587",
"Created": "2022-03-23T16:39:21.843406633+01:00",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": {},
"Config": [
{
"Subnet": "172.20.0.0/16"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {},
"Options": {
"com.docker.network.driver.mtu": "1450"
},
"Labels": {}
}
] UPDATE: Supplying the |
Ugh, my network describing was misleading, as it was from my local machine, when attaching the existing network in k3d worked fine. Also I've surely restarted Docker daemon after the network creation. Yeah, for networks:
zenith_net:
name: zenith_net
ipam:
config:
- subnet: "172.20.42.0/24"
gateway: 172.20.42.1 I'll try watching the gateway value and maybe try to run with and without it in CI. |
k3d should now error out if there's no gateway defined, as it's a hard requirement to set host.k3d.internal, where host.docker.internal is not present. I guess your main issue is fixed by setting the gateway IP, but feel free to reopen this if you need further work from k3d's side 👍 |
Thanks for the followup @iwilltry42 thats a good find - will have to set that on my end when making the docker network. |
What did you do
I have a Docker network
zenith_net
which is created bydocker-compose
using the following config:Then I try to create a cluster:
And get an error:
It first reproduced a couple of times on my local machine, but the problem disappeared after reboot. And now it is stably reproducible in GitHub Actions CI.
What did you expect to happen
Cluster is created without errors.
Screenshots or terminal output
Which OS & Architecture
Linux x86_64:
Pop!_OS 21.10
Ubuntu 20.04.4 LTS
Which version of
k3d
Locally and in CI:
Which version of docker
Locally:
In CI:
The text was updated successfully, but these errors were encountered: