Skip to content

Commit

Permalink
LXC install K3s
Browse files Browse the repository at this point in the history
  • Loading branch information
dpurge committed Jun 15, 2024
1 parent 0e7aeaf commit ce9f6fe
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions content/docs/devops/linux/ubuntu.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,44 @@ Prepare container after creation from image:
sudo dpkg-reconfigure openssh-server

```

Install K3s in Proxmox LXC container:

In Proxmox host, change `/etc/sysctl.conf`:

```sh
net.ipv4.ip_forward=1
vm.swapiness=0
```

Disable swap in `/etc/fstab` and on command line: `swapoff -a`

Edit container confirguration in `/etc/pve/lxc/$ContainerID.conf`:

```sh
features: nesting=1
swap: 0
lxc.apparmor.profile: unconfined
lxc.cgroup2.devices.allow: a
lxc.cap.drop:
lxc.mount.auto: "proc:rw sys:rw"
```

Create `/etc/rc.local`:

```sh
#!/bin/sh -e
if [ ! -e /dev/kmsg ]; then
ln -s /dev/console /dev/kmsg
fi
mount --make-rshared /
```

Make it executable nad run it:

```sh
chmod +x /etc/rc.local
/etc/rc.local
```

Install K3s: `curl -sfL https://get.k3s.io | sh -`

0 comments on commit ce9f6fe

Please sign in to comment.