Skip to content

Instantly share code, notes, and snippets.

@Monarch73
Created April 29, 2024 08:37
Show Gist options
  • Save Monarch73/8642c7b25c199e5d572694242f97c793 to your computer and use it in GitHub Desktop.
Save Monarch73/8642c7b25c199e5d572694242f97c793 to your computer and use it in GitHub Desktop.
Install microk8s in proxmox

Installing microk8s in an LXC container (i.e.: proxmox)

This is an roundition of https://gist.github.com/acj/3cb5674670e6145fa4f355b3239165c7 which got a bit messy

  1. Create a LXC container through the Proxmox web interface (ie.: ubuntu.23-10-lts)
    • untick "unpriviledged" container
    • in memory, set swap to 1024
    • set mem to at least 4096
    • in network, make sure you assign static ip-adress to the container
    • create container but don't start it.
    • after create, go to options and tick "fuse" and "nesting"
    • in /etc/pve/lxc/*.conf add these lines:
      • lxc.apparmor.profile: unconfined
      • lxc.cap.drop:
      • lxc.mount.auto: proc:rw sys:rw
      • lxc.mount.entry: /dev/fuse dev/fuse none bind,create=file 0 0
      • lxc.mount.entry: /sys/kernel/security sys/kernel/security none bind,create=file 0 0
    • run container
  2. Setup microk8s
    • inside container start crontab -e command
      • add line "@reboot ln -s /dev/console /dev/kmsg"
    • install required packages
      • apt update && apt upgrade -y && apt install snapd squashfuse fuse sudo -y
    • reboot container
    • install microk8s
      • snap install microk8s --classic
@Monarch73
Copy link
Author

apparmor_parser --add /var/lib/snapd/apparmor/profiles/snap.microk8s.*
microk8s start

fixes a problem, when micok8s refuses to boot:

Please make sure that the snapd.apparmor service is enabled and started```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment