skip to Main Content

I am trying to setup an LXC container (debian) as a Kubernetes node.
I am so far that the only thing in the way is the kubeadm init script…

error execution phase preflight: [preflight] Some fatal errors occurred:
        [ERROR SystemVerification]: failed to parse kernel config: unable to load kernel module: "configs", output: "modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/5.4.44-2-pve/modules.dep.bin'nmodprobe: FATAL: Module configs not found in directory /lib/modules/5.4.44-2-pven", err: exit status 1
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
To see the stack trace of this error execute with --v=5 or higher

After some research I figured out that I probably need to add the following: linux.kernel_modules: ip_tables,ip6_tables,netlink_diag,nf_nat,overlay
But adding this to /etc/pve/lxc/107.conf doesn’t do anything.

Does anybody have a clue how to add the linux kernel modules?

3

Answers


  1. I’m not sure what guide you are following but assuming that you have the required kernel modules on the host, this would do it:

    lxc config set my-container linux.kernel_modules overlay
    

    You can follow this guide from K3s too. Basically:

    lxc config edit k3s-lxc
    

    and

    config:
      linux.kernel_modules: ip_tables,ip6_tables,netlink_diag,nf_nat,overlay
      raw.lxc: lxc.mount.auto=proc:rw sys:rw
      security.privileged: "true"
      security.nesting: "true"
    

    ✌️

    Login or Signup to reply.
  2. To allow load with modprobe any modules inside privileged proxmox lxc container, you need add this options to container config:

    lxc.apparmor.profile: unconfined
    lxc.cgroup.devices.allow: a
    lxc.cap.drop:
    lxc.mount.auto: proc:rw sys:rw
    lxc.mount.entry: /lib/modules lib/modules none bind 0 0
    

    before that, you must first create the /lib/modules folder inside the container

    Login or Signup to reply.
  3. For the fix ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file run from the host:

    pct set $VMID --mp0 /usr/lib/modules/$(uname -r),mp=/lib/modules/$(uname -r),ro=1,backup=0
    

    For the fix [ERROR SystemVerification]: failed to parse kernel config run from the host:

    pct push $VMID /boot/config-$(uname -r) /boot/config-$(uname -r)
    

    Where $VMID is your container id.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search