Proxmox k3s p1 – Install



Part one of the “Proxmox k3s” series. This part describes the full process for installing k3s on a NixOS VM running in Proxmox. In this tutorial we manually partition the disks that nix is installed on using LVM.

– nix iso link:
– nix k3s link:

After partitioning `fdisk -l /dev/sda` should give:

/dev/sda1 2048 4047 2000 1000K BIOS boot
/dev/sda2 4096 1028095 1024000 500M EFI System
/dev/sda3 1028096 1048573951 1047545856 499.5G Linux LVM

Commands for mounting partitions:

pvcreate /dev/sda3
vgcreate vg /dev/sda3
lvcreate -L 8G -n swap vg
lvcreate -l +100%FREE -n root vg
mkfs.vfat -n boot /dev/sda2
mkswap -L swap /dev/vg/swap
mkfs.ext4 -L root /dev/vg/root
mkdir /mnt/boot
mount /dev/sda2 /mnt/boot
mount /dev/vg/root /mnt
swapon /dev/vg/swap
nixos-generate-config –root /mnt
nixos-install

Important /mnt/etc/nixos/configuration.nix settings:

environment.systemPackages = with pkgs; [
vim
wget
pkgs.k3s
];
services.openssh.enable = true;
services.openssh.permitRootLogin = “yes”;
services.openssh.passwordAuthentication = true;

services.k3s.enable = true;
services.k3s.role = “server”;
services.k3s.extraFlags = toString [
# “–kubelet-arg=v=4” # Optionally add additionally args to k3s
];
# Open ports in the firewall.
networking.firewall.allowedTCPPorts = [
6443 # k3s API server
# k3s ports for “High Availability Embedded etcd”
# 2379 # k3s etcd clients
# 2380 # k3s etcd peers
];
# networking.firewall.allowedUDPPorts = [
# 8472 # k3s flannel for multi-node or inter-node networking
# ];

[ad_2]

source

Exit mobile version