Tuan-Dat Tran f0a45e3fda fix: configure explicit NTP servers in timesyncd instead of relying on DHCP
Gateway at 192.168.20.1 was being provided via DHCP as the NTP server but
does not serve NTP, causing NodeClockNotSynchronising across all nodes.
2026-04-20 20:56:30 +02:00
2026-02-28 11:30:58 +01:00
2026-01-26 23:08:34 +01:00
wip
2025-06-07 00:16:54 +02:00
2025-11-07 20:44:14 +01:00
2025-11-07 20:44:14 +01:00
2025-07-27 22:59:01 +02:00
2025-11-07 20:44:14 +01:00

TuDatTr IaC

I do not recommend this project being used for one's own infrastructure, as this project is heavily attuned to my specific host/network setup.

This Ansible project automates the setup of a K3s Kubernetes cluster on Proxmox VE. It also includes playbooks for configuring Docker hosts, load balancers, and other services.

Repository Structure

The repository is organized into the following main directories:

  • playbooks/: Contains the main Ansible playbooks for different setup scenarios.
  • roles/: Contains the Ansible roles that are used by the playbooks.
  • vars/: Contains variable files, including group-specific variables.

Playbooks

The following playbooks are available:

  • proxmox.yml: Provisions VMs and containers on Proxmox VE.
  • k3s-servers.yml: Sets up the K3s master nodes.
  • k3s-agents.yml: Sets up the K3s agent nodes.
  • k3s-loadbalancer.yml: Configures a load balancer for the K3s cluster.
  • k3s-storage.yml: Configures storage for the K3s cluster.
  • docker.yml: Sets up Docker hosts and their load balancer.
  • docker-host.yml: Configures the docker hosts.
  • docker-lb.yml: Configures a load balancer for Docker services.
  • kubernetes_setup.yml: A meta-playbook for setting up the entire Kubernetes cluster.

Roles

The following roles are defined:

  • common: Common configuration tasks for all nodes.
  • proxmox: Manages Proxmox VE, including VM and container creation.
  • k3s_server: Installs and configures K3s master nodes.
  • k3s_agent: Installs and configures K3s agent nodes.
  • k3s_loadbalancer: Configures an Nginx-based load balancer for the K3s cluster.
  • k3s_storage: Configures storage solutions for Kubernetes.
  • docker_host: Installs and configures Docker.
  • kubernetes_argocd: Deploys Argo CD to the Kubernetes cluster.
  • node_exporter: Installs the Prometheus Node Exporter for monitoring.
  • reverse_proxy: Configures a Caddy-based reverse proxy.
  • edge_vps: Placeholder role for Edge VPS configuration.

Usage

  1. Install dependencies:

    pip install -r requirements.txt
    ansible-galaxy install -r requirements.yml
    
  2. Configure variables:

    • Create an inventory file (e.g., vars/k3s.ini).
    • Adjust variables in vars/group_vars/ to match your environment.
  3. Run playbooks:

    # To provision VMs on Proxmox
    ansible-playbook -i vars/proxmox.ini playbooks/proxmox.yml
    
    # To set up the K3s cluster
    ansible-playbook -i vars/k3s.ini playbooks/kubernetes_setup.yml
    

Notes

Vault Git Diff

This repo has a .gitattributes which points at the repos ansible-vault files. These can be temporarily decrypted for git diff by adding this in conjunction with the .gitattributes:

# https://stackoverflow.com/questions/29937195/how-to-diff-ansible-vault-changes
git config --global diff.ansible-vault.textconv "ansible-vault view"

Disclaimer

This project is highly customized for the author's specific environment. Using it without modification is not recommended.

Description
No description provided
Readme 16 MiB
Languages
Jinja 86.8%
Shell 13.2%