Skip to content
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

[QUESTION/HELP] Cannot enable DNS fix, as Host Gateway IP is missing #1440

Open
rgruyters opened this issue May 8, 2024 · 5 comments
Open
Labels
question Further information is requested

Comments

@rgruyters
Copy link

Question / Where do you need Help?

I'm trying to create a new cluster with k3d cluster create --network host --wait --no-lb but I hit the following error message:

INFO[0000] [SimpleConfig] Hostnetwork selected - disabling injection of docker host into the cluster, server load balancer and setting the api port to the k3s default
INFO[0000] [ClusterConfig] Hostnetwork selected - disabling injection of docker host into the cluster, server load balancer and setting the api port to the k3s default
INFO[0000] Prep: Network
INFO[0000] Re-using existing network 'host' (1e719cb249ce6493d48c821b55507e3935eb3f12c74e4cfc84a91dc7a52be838)
INFO[0000] Created image volume k3d-k3s-default-images
INFO[0000] Starting new tools node...
INFO[0000] Starting node 'k3d-k3s-default-tools'
INFO[0001] Creating node 'k3d-k3s-default-server-0'
INFO[0001] Using the k3d-tools node to gather environment information
INFO[0001] Starting cluster 'k3s-default'
INFO[0001] Starting servers...
ERRO[0001] Failed Cluster Start: Failed to start server k3d-k3s-default-server-0: failed to enable k3d fixes: Cannot enable DNS fix, as Host Gateway IP is missing!
ERRO[0001] Failed to create cluster >>> Rolling Back
INFO[0001] Deleting cluster 'k3s-default'
INFO[0001] Deleting 1 attached volumes...
FATA[0001] Cluster creation FAILED, all changes have been rolled back!

Scope of your Question

k3d/k3s versions:

k3d version v5.6.3
k3s version v1.28.8-k3s1 (default)

Docker:

Client: Docker Engine - Community
 Version:           26.1.1
 API version:       1.45
 Go version:        go1.21.9
 Git commit:        4cf5afa
 Built:             Tue Apr 30 11:47:53 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          26.1.1
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.21.9
  Git commit:       ac2de55
  Built:            Tue Apr 30 11:47:53 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.31
  GitCommit:        e377cd56a71523140ca6ae87e30244719194a521
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
@rgruyters rgruyters added the question Further information is requested label May 8, 2024
@QrrQ
Copy link

QrrQ commented May 10, 2024

I'm experiencing the same problem

➜  ~ docker version
Client:
 Version:           26.1.2
 API version:       1.45
 Go version:        go1.22.3
 Git commit:        211e74b240
 Built:             Thu May  9 14:45:05 2024
 OS/Arch:           linux/amd64
 Context:           default

Server:
 Engine:
  Version:          26.1.2
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.22.3
  Git commit:       ef1912d8b6
  Built:            Thu May  9 14:45:05 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.7.16
  GitCommit:        83031836b2cf55637d7abf847b17134c51b38e53.m
 runc:
  Version:          1.1.12
  GitCommit:
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
➜  ~ k3d version
k3d version v5.6.3
k3s version v1.28.8-k3s1 (default)
➜  ~ k3d cluster create --network host --verbose
DEBU[0000] DOCKER_SOCK=/var/run/docker.sock
DEBU[0000] Runtime Info:
&{Name:docker Endpoint:/var/run/docker.sock Version:26.1.2 OSType:linux OS:Arch Linux Arch:x86_64 CgroupVersion:2 CgroupDriver:systemd Filesystem:extfs InfoName:who}
DEBU[0000] Additional CLI Configuration:
cli:
  api-port: ""
  env: []
  k3s-node-labels: []
  k3sargs: []
  ports: []
  registries:
    create: ""
  runtime-labels: []
  runtime-ulimits: []
  volumes: []
hostaliases: []
DEBU[0000] Configuration:
agents: 0
image: docker.io/rancher/k3s:v1.28.8-k3s1
network: host
options:
  k3d:
    disableimagevolume: false
    disableloadbalancer: false
    disablerollback: false
    loadbalancer:
      configoverrides: []
    timeout: 0s
    wait: true
  kubeconfig:
    switchcurrentcontext: true
    updatedefaultkubeconfig: true
  runtime:
    agentsmemory: ""
    gpurequest: ""
    hostpidmode: false
    serversmemory: ""
registries:
  config: ""
  use: []
servers: 1
subnet: ""
token: ""
DEBU[0000] ========== Simple Config ==========
{TypeMeta:{Kind:Simple APIVersion:k3d.io/v1alpha5} ObjectMeta:{Name:} Servers:1 Agents:0 ExposeAPI:{Host: HostIP: HostPort:} Image:docker.io/rancher/k3s:v1.28.8-k3s1 Network:host Subnet: ClusterToken: Volumes:[] Ports:[] Options:{K3dOptions:{Wait:true Timeout:0s DisableLoadbalancer:false DisableImageVolume:false NoRollback:false NodeHookActions:[] Loadbalancer:{ConfigOverrides:[]}} K3sOptions:{ExtraArgs:[] NodeLabels:[]} KubeconfigOptions:{UpdateDefaultKubeconfig:true SwitchCurrentContext:true} Runtime:{GPURequest: ServersMemory: AgentsMemory: HostPidMode:false Labels:[] Ulimits:[]}} Env:[] Registries:{Use:[] Create:<nil> Config:} HostAliases:[]}
==========================
DEBU[0000] ========== Merged Simple Config ==========
{TypeMeta:{Kind:Simple APIVersion:k3d.io/v1alpha5} ObjectMeta:{Name:} Servers:1 Agents:0 ExposeAPI:{Host: HostIP: HostPort:43869} Image:docker.io/rancher/k3s:v1.28.8-k3s1 Network:host Subnet: ClusterToken: Volumes:[] Ports:[] Options:{K3dOptions:{Wait:true Timeout:0s DisableLoadbalancer:false DisableImageVolume:false NoRollback:false NodeHookActions:[] Loadbalancer:{ConfigOverrides:[]}} K3sOptions:{ExtraArgs:[] NodeLabels:[]} KubeconfigOptions:{UpdateDefaultKubeconfig:true SwitchCurrentContext:true} Runtime:{GPURequest: ServersMemory: AgentsMemory: HostPidMode:false Labels:[] Ulimits:[]}} Env:[] Registries:{Use:[] Create:<nil> Config:} HostAliases:[]}
==========================
INFO[0000] [SimpleConfig] Hostnetwork selected - disabling injection of docker host into the cluster, server load balancer and setting the api port to the k3s default
DEBU[0000] Host network was chosen, changing provided/random api port to k3s:6443
DEBU[0000] Disabling the load balancer
DEBU[0000] ===== Merged Cluster Config =====
&{TypeMeta:{Kind: APIVersion:} Cluster:{Name:k3s-default Network:{Name:host ID: External:true IPAM:{IPPrefix:invalid Prefix IPsUsed:[] Managed:false} Members:[]} Token: Nodes:[0xc0005b2700] InitNode:<nil> ExternalDatastore:<nil> KubeAPI:0xc0004a41c0 ServerLoadBalancer:<nil> ImageVolume: Volumes:[]} ClusterCreateOpts:{DisableImageVolume:false WaitForServer:true Timeout:0s DisableLoadBalancer:true GPURequest: ServersMemory: AgentsMemory: NodeHooks:[] GlobalLabels:map[app:k3d] GlobalEnv:[] HostAliases:[] Registries:{Create:<nil> Use:[] Config:<nil>}} KubeconfigOpts:{UpdateDefaultKubeconfig:true SwitchCurrentContext:true}}
===== ===== =====
INFO[0000] [ClusterConfig] Hostnetwork selected - disabling injection of docker host into the cluster, server load balancer and setting the api port to the k3s default
DEBU[0000] Host network was chosen, changing provided/random api port to k3s:6443
DEBU[0000] '--kubeconfig-update-default set: enabling wait-for-server
INFO[0000] Prep: Network
DEBU[0000] Found network {Name:host ID:90a942a76d787f15f409d91a9248e9287654b6aa5734205926b465a2a08860f9 Created:2023-02-27 17:20:24.371795072 +0100 CET Scope:local Driver:host EnableIPv6:false IPAM:{Driver:default Options:map[] Config:[]} Internal:false Attachable:false Ingress:false ConfigFrom:{Network:} ConfigOnly:false Containers:map[] Options:map[] Labels:map[] Peers:[] Services:map[]}
DEBU[0000] Network host does not have an IPAM config
INFO[0000] Re-using existing network 'host' (90a942a76d787f15f409d91a9248e9287654b6aa5734205926b465a2a08860f9)
INFO[0000] Created image volume k3d-k3s-default-images
INFO[0000] Starting new tools node...
DEBU[0000] DOCKER_SOCK=/var/run/docker.sock
DEBU[0000] DOCKER_SOCK=/var/run/docker.sock
DEBU[0000] DOCKER_SOCK=/var/run/docker.sock
DEBU[0000] DOCKER_SOCK=/var/run/docker.sock
DEBU[0000] [autofix cgroupsv2] cgroupVersion: 2
DEBU[0000] [Docker] DockerHost: '' ()
DEBU[0000] Created container k3d-k3s-default-tools (ID: fb97b52d5a244087f7b892c75ba47abd200ee2902b115bdcaa303e2b890f9355)
DEBU[0000] Node k3d-k3s-default-tools Start Time: 2024-05-10 11:46:59.188147511 +0200 CEST m=+0.072300098
INFO[0000] Starting node 'k3d-k3s-default-tools'
DEBU[0000] Truncated 2024-05-10 09:46:59.32316429 +0000 UTC to 2024-05-10 09:46:59 +0000 UTC
INFO[0001] Creating node 'k3d-k3s-default-server-0'
DEBU[0001] Created container k3d-k3s-default-server-0 (ID: 3dbb8d42b080ad9234ac447c4fe221924c291e0e898f1d9742ef76941a1da233)
DEBU[0001] Created node 'k3d-k3s-default-server-0'
DEBU[0001] DOCKER_SOCK=/var/run/docker.sock
INFO[0001] Using the k3d-tools node to gather environment information
DEBU[0001] no netlabel present on container /k3d-k3s-default-tools
DEBU[0001] failed to get IP for container /k3d-k3s-default-tools as we couldn't find the cluster network
DEBU[0001] Deleting node k3d-k3s-default-tools ...
INFO[0001] Starting cluster 'k3s-default'
INFO[0001] Starting servers...
DEBU[0001] >>> enabling dns magic
ERRO[0001] Failed Cluster Start: Failed to start server k3d-k3s-default-server-0: failed to enable k3d fixes: Cannot enable DNS fix, as Host Gateway IP is missing!
ERRO[0001] Failed to create cluster >>> Rolling Back
INFO[0001] Deleting cluster 'k3s-default'
DEBU[0001] failed to get IP for container /k3d-k3s-default-server-0 as we couldn't find the cluster network
DEBU[0001] Cluster Details: &{Name:k3s-default Network:{Name:host ID:90a942a76d787f15f409d91a9248e9287654b6aa5734205926b465a2a08860f9 External:true IPAM:{IPPrefix:invalid Prefix IPsUsed:[] Managed:false} Members:[]} Token:iuqFScsHWtATjTHPVpaq Nodes:[0xc0005b2700] InitNode:<nil> ExternalDatastore:<nil> KubeAPI:0xc0004a41c0 ServerLoadBalancer:<nil> ImageVolume:k3d-k3s-default-images Volumes:[k3d-k3s-default-images]}
DEBU[0001] Deleting node k3d-k3s-default-server-0 ...
DEBU[0001] Skip deletion of cluster network 'host' because it's managed externally
INFO[0001] Deleting 1 attached volumes...
DEBU[0001] Deleting volume k3d-k3s-default-images...
FATA[0001] Cluster creation FAILED, all changes have been rolled back!

@ChristianWolf2
Copy link

It still works with 5.6.0!

@rgruyters
Copy link
Author

Correct! 5.6.0 works fine.

@QrrQ
Copy link

QrrQ commented May 10, 2024

It still works with 5.6.0!

I confirm It works for me too with 5.6.0

@Mikycid
Copy link

Mikycid commented May 21, 2024

I have the same problem with the v5.6.3 just specifying the host network :

admusr@esp-26:~/cluster$ k3d --version
k3d version v5.6.3
k3s version v1.28.8-k3s1 (default)
admusr@esp-26:~/cluster$ k3d cluster create test-cluster --network host
INFO[0000] [SimpleConfig] Hostnetwork selected - disabling injection of docker host into the cluster, server load balancer and setting the api port to the k3s default
INFO[0000] [ClusterConfig] Hostnetwork selected - disabling injection of docker host into the cluster, server load balancer and setting the api port to the k3s default
INFO[0000] Prep: Network
INFO[0000] Re-using existing network 'host' (f55e702cab7f61b535c1699c455cb9b4d18ef3386a97f9ebabb6393c8947eea3)
INFO[0000] Created image volume k3d-test-cluster-images
INFO[0000] Starting new tools node...
INFO[0000] Starting node 'k3d-test-cluster-tools'
INFO[0001] Creating node 'k3d-test-cluster-server-0'
INFO[0001] Using the k3d-tools node to gather environment information
INFO[0001] Starting cluster 'test-cluster'
INFO[0001] Starting servers...
ERRO[0001] Failed Cluster Start: Failed to start server k3d-test-cluster-server-0: failed to enable k3d fixes: Cannot enable DNS fix, as Host Gateway IP is missing!
ERRO[0001] Failed to create cluster >>> Rolling Back
INFO[0001] Deleting cluster 'test-cluster'
INFO[0001] Deleting 1 attached volumes...
FATA[0001] Cluster creation FAILED, all changes have been rolled back!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants