Install and create a Kubernetes cluster on lxc proxmox
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
Running Kubernetes on Proxmox LXC containers is possible, but it requires careful container privilege and kernel feature settings. Unlike full virtual machines, LXC shares the host kernel, so missing cgroup or namespace capabilities can break kubelet startup. A stable setup starts with correctly configured privileged containers, networking, and runtime prerequisites before cluster bootstrap.
Plan Topology and Proxmox Container Settings
Define at least one control-plane node and one worker node. For learning clusters, three containers are common:
k8s-cp-1k8s-worker-1k8s-worker-2
In Proxmox, create containers with enough memory and CPU. Kubernetes control plane in LXC is sensitive to low memory pressure.
Important container options:
- nested containers enabled
- keyctl enabled
- cgroup access enabled
- privileged mode preferred for simpler setup
After creating containers, verify network reachability between nodes with static IP assignments.
Prepare Each LXC Node for Kubernetes
Install base packages and disable swap.
Load required kernel modules and sysctl settings:
These settings are mandatory for pod networking and service routing.
Install Container Runtime and Kubernetes Components
Install containerd and Kubernetes binaries on all nodes.
Install kubeadm stack:
Adjust version stream to your desired Kubernetes minor release.
Initialize Control Plane and Join Workers
On control-plane container:
Configure kubectl for your user:
Install CNI plugin. Flannel example:
Then run the kubeadm join command shown by init on each worker node.
Proxmox and LXC-Specific Troubleshooting
Common errors on LXC clusters include kubelet crash loops tied to missing cgroup features or permission limits.
Diagnostic commands:
If kubelet reports cgroup driver mismatch, align containerd and kubelet drivers. Also ensure Proxmox host kernel supports required cgroup versions consistently.
Networking errors often come from bridge settings on Proxmox host. Confirm containers can ping each other by IP before blaming CNI.
Production Notes and Safer Alternatives
LXC-based Kubernetes is excellent for labs and constrained homelabs, but production clusters usually run on VMs or bare metal for stronger isolation and fewer kernel coupling issues. If you need high reliability, consider Proxmox VMs with cloud-init automation.
Still, for development clusters, LXC can be fast and resource-efficient when configuration is documented and reproducible.
Common Pitfalls
- Creating unprivileged LXC containers without required kernel capabilities.
- Forgetting to disable swap before kubeadm initialization.
- Skipping cgroup and sysctl preparation steps.
- Expecting CNI to work when node-to-node container networking is already broken.
- Treating LXC lab setup as production-ready without isolation analysis.
Summary
- Kubernetes on Proxmox LXC works when container capabilities are configured correctly.
- Prepare kernel modules, sysctl, runtime, and kubeadm dependencies on every node.
- Initialize control plane first, then install CNI and join workers.
- Use kubelet logs and node-level networking checks for troubleshooting.
- Prefer VMs for production and LXC for efficient lab environments.

