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

k3s does not start in airgapped set up #622

Open
PidgeyBE opened this issue Nov 22, 2024 · 8 comments
Open

k3s does not start in airgapped set up #622

PidgeyBE opened this issue Nov 22, 2024 · 8 comments
Labels
question Further information is requested

Comments

@PidgeyBE
Copy link

Hi

When deploying k3s via EIB, k3s will not start if there is no ethernet cable plugged in into the device.
This results in:

[FAILED] Failed to start Network Manager Wait Online.
[FAILED] Failed to start Lightweight Kubernetes.

When inspecting journalctl -u k3s I see
level=fatal msg="no default routes found in "/proc/net/route" or "/proc/net/ipv6_route"

Am I doing something wrong or is EIB not made to be used in fully airgapped situations?
Even if I install the same ISO on a device with ethernet cable plugged in, I get the same issues on first boot. After rebooting, k3s does start.

BR, Pj

@atanasdinov
Copy link
Contributor

Hello! EIB is definitely meant to be used in airgapped environments. It will, however, not assume there's a missing network. One of the main requirements for both k3s and RKE2 is to have a default route set up -- please see https://docs.k3s.io/installation/airgap#default-network-route.

There are numerous ways of configuring the network with EIB, please check our official docs to figure out what's the proper approach for your use case.

@jdob
Copy link
Contributor

jdob commented Nov 22, 2024

@PidgeyBE If you're comfortable with Atanas' answer, can you please close out the issue?

@jdob jdob added the question Further information is requested label Nov 22, 2024
@PidgeyBE
Copy link
Author

Definitely!

I've been using the information shared by Atanas to try to come to a working setup, but unfortunately I haven't succeeded yet.
A sample configuration of how to exactly configure EIB to have a dummy network interface would be very helpful.

@atanasdinov
Copy link
Contributor

You can follow the custom configuration e.g. something along the lines of:

mkdir -p $CONFIG_DIR/network

cat << EOF > $CONFIG_DIR/network/configure-network.sh
#!/bin/bash
set -eux

ip link add dummy0 type dummy
ip link set dummy0 up
ip addr add 203.0.113.254/31 dev dummy0
ip route add default via 203.0.113.255 dev dummy0 metric 1000
EOF

chmod a+x $CONFIG_DIR/network/configure-network.sh

This will use the "custom network script" functionality of EIB which in turn executes the example from the k3s docs about a dummy route. I haven't tested it but I'd expect this to work.

@PidgeyBE
Copy link
Author

Yeah, I've tried something similar before, but it didnt work.
Reproduced the issue with your example:

image

@atanasdinov
Copy link
Contributor

Can you show the output of these two:

  1. journalctl -u combustion-prepare
  2. journalctl -u combustion

These are first things to check when there's a failure in the boot process.

@PidgeyBE
Copy link
Author

Thanks, good to know!
Seems like it doesn't know the device type dummy...
image

@PidgeyBE
Copy link
Author

PidgeyBE commented Dec 2, 2024

I fixed this by creating network/_all.yaml with:

interfaces:
  - name: eth0
    type: ethernet
    state: up
    ipv4:
      enabled: true
      dhcp: true
  - name: dummy0
    type: dummy
    state: up
    ipv4:
      enabled: true
      address:
        - ip: 203.0.113.254
          prefix-length: 31
routes:
  config:
    - destination: 0.0.0.0/0
      next-hop-address: 203.0.113.255
      next-hop-interface: dummy0
      metric: 2000

That works.

Although, in case a network cable is connected, the eth0 does not get an IP address on first boot. On second boot the interface works...
So that's still a remaining issue

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

3 participants