# leandrosalvas/deploy-k8s-terraform-proxmox architecture

> Architecture diagram of the GitHub repository leandrosalvas/deploy-k8s-terraform-proxmox, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/leandrosalvas/deploy-k8s-terraform-proxmox
- Repository: https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox

## Overview

This repository automates deployment of a highly available Kubernetes cluster on Proxmox. The documented workflow is Terraform provisioning of VMs, cluster initialization and node joining, automatic installation of networking and cluster add-ons, then retrieval of kubeconfig and access tokens. The README documents these capabilities, but no source excerpts were provided, so implementation-level calls and ownership cannot be verified; paths below identify the corresponding Terraform or provisioning areas in the tree.

Main entry points: [`terraform-k8s-proxmox/templates/scripts/master-init.sh`](https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/templates/scripts/master-init.sh) (Control plane), [`terraform-k8s-proxmox/main.tf`](https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/main.tf) (Terraform deployment), [`terraform-k8s-proxmox/modules/k8s-cluster/main.tf`](https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/modules/k8s-cluster/main.tf) (VM provisioning), [`terraform-k8s-proxmox/scripts/configure-cloudinit.sh`](https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/scripts/configure-cloudinit.sh) (Cloud-init setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_provision["Infrastructure provisioning"]
  node_terraform["Terraform deployment<br/>[main.tf]"]
  node_proxmox["Proxmox VE"]
  node_cluster_module["VM provisioning<br/>[main.tf]"]
  node_cloudinit["Cloud-init setup"]
end

subgraph group_cluster["Cluster bootstrap"]
  node_control_plane["Control plane<br/>[master-init.sh]"]
  node_master_join["HA master join<br/>[master-join.sh]"]
  node_worker_join["Worker join<br/>[worker-join.sh]"]
  node_crio["CRI-O runtime<br/>[common.sh]"]
  node_vip["kube-vip<br/>[master-init.sh]"]
end

subgraph group_addons["Cluster add-ons"]
  node_calico["Calico CNI<br/>[master-init.sh]"]
  node_metallb["MetalLB"]
  node_metrics["Metrics Server<br/>[master-init.sh]"]
  node_dashboard["Kubernetes Dashboard<br/>[master-init.sh]"]
end

subgraph group_access["Cluster access"]
  node_file_server["HTTPS file server<br/>[master-init.sh]"]
  node_access_files["Kubeconfig and tokens<br/>[master-init.sh]"]
end

node_client(("Operator"))

node_client -->|"runs apply"| node_terraform
node_terraform -->|"provisions on"| node_proxmox
node_terraform -.->|"provisions VMs"| node_cluster_module
node_cluster_module -.->|"configures nodes"| node_cloudinit
node_client -.->|"triggers deployment"| node_control_plane
node_control_plane -->|"supports HA peers"| node_master_join
node_control_plane -->|"joins workers"| node_worker_join
node_control_plane -->|"uses runtime"| node_crio
node_control_plane -->|"installs"| node_vip
node_control_plane -->|"installs"| node_calico
node_control_plane -->|"installs"| node_metallb
node_control_plane -->|"installs"| node_metrics
node_control_plane -->|"installs"| node_dashboard
node_client -->|"downloads from"| node_file_server
node_file_server -->|"serves"| node_access_files

click node_terraform "https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/main.tf"
click node_cluster_module "https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/modules/k8s-cluster/main.tf"
click node_cloudinit "https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/scripts/configure-cloudinit.sh"
click node_control_plane "https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/templates/scripts/master-init.sh"
click node_master_join "https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/templates/scripts/master-join.sh"
click node_worker_join "https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/templates/scripts/worker-join.sh"
click node_crio "https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/templates/scripts/common.sh"
click node_vip "https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/templates/scripts/master-init.sh"
click node_calico "https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/templates/scripts/master-init.sh"
click node_metallb "https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/manifests/metallb-config.yaml"
click node_metrics "https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/templates/scripts/master-init.sh"
click node_dashboard "https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/templates/scripts/master-init.sh"
click node_file_server "https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/templates/scripts/master-init.sh"
click node_access_files "https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/templates/scripts/master-init.sh"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_terraform,node_proxmox,node_cluster_module,node_cloudinit toneBlue
class node_control_plane,node_master_join,node_worker_join,node_crio,node_vip toneAmber
class node_calico,node_metallb,node_metrics,node_dashboard toneMint
class node_file_server,node_access_files toneRose
class node_client toneIndigo
```

## Components

### Infrastructure provisioning

- [Terraform deployment](https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/main.tf): `terraform-k8s-proxmox/main.tf`
- **Proxmox VE**
- [VM provisioning](https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/modules/k8s-cluster/main.tf): `terraform-k8s-proxmox/modules/k8s-cluster/main.tf`
- [Cloud-init setup](https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/scripts/configure-cloudinit.sh): `terraform-k8s-proxmox/scripts/configure-cloudinit.sh`

### Cluster bootstrap

- [Control plane](https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/templates/scripts/master-init.sh): `terraform-k8s-proxmox/templates/scripts/master-init.sh`
- [HA master join](https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/templates/scripts/master-join.sh): `terraform-k8s-proxmox/templates/scripts/master-join.sh`
- [Worker join](https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/templates/scripts/worker-join.sh): `terraform-k8s-proxmox/templates/scripts/worker-join.sh`
- [CRI-O runtime](https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/templates/scripts/common.sh): `terraform-k8s-proxmox/templates/scripts/common.sh`
- [kube-vip](https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/templates/scripts/master-init.sh): `terraform-k8s-proxmox/templates/scripts/master-init.sh`

### Cluster add-ons

- [Calico CNI](https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/templates/scripts/master-init.sh): `terraform-k8s-proxmox/templates/scripts/master-init.sh`
- [MetalLB](https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/manifests/metallb-config.yaml): `terraform-k8s-proxmox/manifests/metallb-config.yaml`
- [Metrics Server](https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/templates/scripts/master-init.sh): `terraform-k8s-proxmox/templates/scripts/master-init.sh`
- [Kubernetes Dashboard](https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/templates/scripts/master-init.sh): `terraform-k8s-proxmox/templates/scripts/master-init.sh`

### Cluster access

- [HTTPS file server](https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/templates/scripts/master-init.sh): `terraform-k8s-proxmox/templates/scripts/master-init.sh`
- [Kubeconfig and tokens](https://github.com/leandrosalvas/deploy-k8s-terraform-proxmox/blob/main/terraform-k8s-proxmox/templates/scripts/master-init.sh): `terraform-k8s-proxmox/templates/scripts/master-init.sh`

### Other components

- **Operator**

## Connections

- Operator → Terraform deployment: runs apply (evidence: `README.md`)
- Terraform deployment → Proxmox VE: provisions on (evidence: `README.md`)
- Terraform deployment → VM provisioning: provisions VMs
- VM provisioning → Cloud-init setup: configures nodes
- Operator → Control plane: triggers deployment
- Control plane → HA master join: supports HA peers (evidence: `README.md`)
- Control plane → Worker join: joins workers (evidence: `README.md`)
- Control plane → CRI-O runtime: uses runtime (evidence: `README.md`)
- Control plane → kube-vip: installs (evidence: `README.md`)
- Control plane → Calico CNI: installs (evidence: `README.md`)
- Control plane → MetalLB: installs (evidence: `README.md`)
- Control plane → Metrics Server: installs (evidence: `README.md`)
- Control plane → Kubernetes Dashboard: installs (evidence: `README.md`)
- Operator → HTTPS file server: downloads from (evidence: `README.md`)
- HTTPS file server → Kubeconfig and tokens: serves (evidence: `README.md`)
