This repository contains Ansible playbooks for deploying and managing a K3s cluster on Proxmox virtual machines.
.
├── inventory/ # Inventory definitions
├── roles/ # Role definitions
│ ├── common/ # Common server setup
│ ├── k3s/ # K3s cluster configuration
│ └── proxmox_host_setup/ # Proxmox VM provisioning
└── playbooks/ # Main playbooks
- Ansible 2.9 or higher
- Access to a Proxmox server
- Vault password for encrypted variables
ansible-playbook -i inventory/inventory common-setup-hosts.yml
Configures basic server settings including:
- System packages
- Firewall rules
- SSH security
- Fail2ban
- Time synchronization
ansible-playbook -i inventory/inventory k3s-setup.yml
Deploys K3s cluster with:
- Master node configuration
- Worker node configuration
- Network policies
- Storage configuration
# Deploy with vault password prompt
ansible-playbook -i inventory/inventory proxmox_host_setup.yml --ask-vault-pass
# Deploy with vault password file
ansible-playbook -i inventory/inventory proxmox_host_setup.yml --vault-password-file ~/.vault_pass.txt
# Create new vault file
ansible-vault create roles/proxmox_host_setup/vars/vault.yml
# Encrypt single string
ansible-vault encrypt_string 'secret_value' --name 'secret_name'
# Edit vault file
ansible-vault edit roles/proxmox_host_setup/vars/vault.yml
# Change vault password
ansible-vault rekey roles/proxmox_host_setup/vars/vault.yml
The inventory file (inventory/inventory
) defines the following node groups:
master-node
: K3s master nodesworker-node
: K3s worker nodesllm
: Machine learning nodes (optional)