# zaidsasa/vagrant-kubernetes-cluster architecture

> Architecture diagram of the GitHub repository zaidsasa/vagrant-kubernetes-cluster, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zaidsasa/vagrant-kubernetes-cluster
- Repository: https://github.com/zaidsasa/vagrant-kubernetes-cluster

## Overview

This repository provisions a Kubernetes practice cluster for certification training. The documented user flow is to run `vagrant up`, use the generated kubeconfig, and optionally enable and access the Kubernetes Dashboard. The tree shows Ansible roles for shared machine setup, control-plane setup, and worker setup, plus inventory and IP helpers. Those implementation files were not sampled, so their internal call and provisioning relationships are not asserted; dashed links mark inferred wiring.

Main entry points: [`provisioning/playbook.yaml`](https://github.com/zaidsasa/vagrant-kubernetes-cluster/blob/main/provisioning/playbook.yaml) (Ansible playbook), [`provisioning/roles/common/tasks`](https://github.com/zaidsasa/vagrant-kubernetes-cluster/tree/main/provisioning/roles/common/tasks) (Common host setup), [`Vagrantfile`](https://github.com/zaidsasa/vagrant-kubernetes-cluster/blob/main/Vagrantfile) (Vagrant lifecycle), [`settings.yaml`](https://github.com/zaidsasa/vagrant-kubernetes-cluster/blob/main/settings.yaml) (Cluster settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Cluster entry"]
  node_vagrant["Vagrant lifecycle"]
  node_inventory["Dynamic inventory"]
  node_ipblocks["IP allocation<br/>[ipblocks.rb]"]
  node_settings["Cluster settings<br/>[settings.yaml]"]
end

subgraph group_provision["Provisioning"]
  node_playbook["Ansible playbook<br/>[playbook.yaml]"]
  node_common["Common host setup"]
  node_controlplane["Control-plane setup"]
  node_workers["Worker setup"]
end

subgraph group_features["Cluster capabilities"]
  node_runtime["CRI-O runtime"]
  node_kubernetes["Kubernetes install"]
  node_calico["Calico networking"]
  node_dashboard["Kubernetes Dashboard"]
  node_cluster{{"Practice cluster"}}
  node_kubeconfig["Kubeconfig"]
end

node_learner(("Cluster operator"))

node_learner -->|"starts cluster"| node_vagrant
node_vagrant -.->|"provisions"| node_cluster
node_playbook -.->|"configures hosts"| node_common
node_playbook -.->|"configures control plane"| node_controlplane
node_playbook -.->|"configures workers"| node_workers
node_common -.->|"installs"| node_runtime
node_common -.->|"installs"| node_kubernetes
node_controlplane -.->|"installs"| node_calico
node_learner -->|"enables dashboard"| node_settings
node_settings -.->|"configures install"| node_dashboard
node_learner -->|"sets environment"| node_kubeconfig
node_learner -->|"accesses"| node_dashboard

click node_vagrant "https://github.com/zaidsasa/vagrant-kubernetes-cluster/blob/main/Vagrantfile"
click node_inventory "https://github.com/zaidsasa/vagrant-kubernetes-cluster/blob/main/dynamic_inventory.rb"
click node_ipblocks "https://github.com/zaidsasa/vagrant-kubernetes-cluster/blob/main/ipblocks.rb"
click node_playbook "https://github.com/zaidsasa/vagrant-kubernetes-cluster/blob/main/provisioning/playbook.yaml"
click node_common "https://github.com/zaidsasa/vagrant-kubernetes-cluster/tree/main/provisioning/roles/common/tasks"
click node_controlplane "https://github.com/zaidsasa/vagrant-kubernetes-cluster/tree/main/provisioning/roles/controlplane/tasks"
click node_workers "https://github.com/zaidsasa/vagrant-kubernetes-cluster/tree/main/provisioning/roles/node/tasks"
click node_runtime "https://github.com/zaidsasa/vagrant-kubernetes-cluster/blob/main/provisioning/roles/common/tasks/install-container-runtime.yaml"
click node_kubernetes "https://github.com/zaidsasa/vagrant-kubernetes-cluster/blob/main/provisioning/roles/common/tasks/install-kubernetes.yaml"
click node_calico "https://github.com/zaidsasa/vagrant-kubernetes-cluster/blob/main/provisioning/roles/controlplane/tasks/install-calico.yaml"
click node_dashboard "https://github.com/zaidsasa/vagrant-kubernetes-cluster/blob/main/provisioning/roles/controlplane/tasks/install-dashboard.yaml"
click node_settings "https://github.com/zaidsasa/vagrant-kubernetes-cluster/blob/main/settings.yaml"
click node_kubeconfig "https://github.com/zaidsasa/vagrant-kubernetes-cluster/blob/main/provisioning/roles/controlplane/tasks/configure-kubeconfig.yaml"

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_vagrant,node_inventory,node_ipblocks,node_settings toneBlue
class node_playbook,node_common,node_controlplane,node_workers toneAmber
class node_runtime,node_kubernetes,node_calico,node_dashboard,node_cluster,node_kubeconfig toneMint
class node_learner toneIndigo
```

## Components

### Cluster entry

- [Vagrant lifecycle](https://github.com/zaidsasa/vagrant-kubernetes-cluster/blob/main/Vagrantfile): `Vagrantfile`
- [Dynamic inventory](https://github.com/zaidsasa/vagrant-kubernetes-cluster/blob/main/dynamic_inventory.rb): `dynamic_inventory.rb`
- [IP allocation](https://github.com/zaidsasa/vagrant-kubernetes-cluster/blob/main/ipblocks.rb): `ipblocks.rb`
- [Cluster settings](https://github.com/zaidsasa/vagrant-kubernetes-cluster/blob/main/settings.yaml): `settings.yaml`

### Provisioning

- [Ansible playbook](https://github.com/zaidsasa/vagrant-kubernetes-cluster/blob/main/provisioning/playbook.yaml): `provisioning/playbook.yaml`
- [Common host setup](https://github.com/zaidsasa/vagrant-kubernetes-cluster/tree/main/provisioning/roles/common/tasks): `provisioning/roles/common/tasks`
- [Control-plane setup](https://github.com/zaidsasa/vagrant-kubernetes-cluster/tree/main/provisioning/roles/controlplane/tasks): `provisioning/roles/controlplane/tasks`
- [Worker setup](https://github.com/zaidsasa/vagrant-kubernetes-cluster/tree/main/provisioning/roles/node/tasks): `provisioning/roles/node/tasks`

### Cluster capabilities

- [CRI-O runtime](https://github.com/zaidsasa/vagrant-kubernetes-cluster/blob/main/provisioning/roles/common/tasks/install-container-runtime.yaml): `provisioning/roles/common/tasks/install-container-runtime.yaml`
- [Kubernetes install](https://github.com/zaidsasa/vagrant-kubernetes-cluster/blob/main/provisioning/roles/common/tasks/install-kubernetes.yaml): `provisioning/roles/common/tasks/install-kubernetes.yaml`
- [Calico networking](https://github.com/zaidsasa/vagrant-kubernetes-cluster/blob/main/provisioning/roles/controlplane/tasks/install-calico.yaml): `provisioning/roles/controlplane/tasks/install-calico.yaml`
- [Kubernetes Dashboard](https://github.com/zaidsasa/vagrant-kubernetes-cluster/blob/main/provisioning/roles/controlplane/tasks/install-dashboard.yaml): `provisioning/roles/controlplane/tasks/install-dashboard.yaml`
- **Practice cluster**
- [Kubeconfig](https://github.com/zaidsasa/vagrant-kubernetes-cluster/blob/main/provisioning/roles/controlplane/tasks/configure-kubeconfig.yaml): `provisioning/roles/controlplane/tasks/configure-kubeconfig.yaml`

### Other components

- **Cluster operator**

## Connections

- Cluster operator → Vagrant lifecycle: starts cluster (evidence: `README.md`)
- Vagrant lifecycle → Practice cluster: provisions
- Ansible playbook → Common host setup: configures hosts
- Ansible playbook → Control-plane setup: configures control plane
- Ansible playbook → Worker setup: configures workers
- Common host setup → CRI-O runtime: installs
- Common host setup → Kubernetes install: installs
- Control-plane setup → Calico networking: installs
- Cluster operator → Cluster settings: enables dashboard (evidence: `README.md`)
- Cluster settings → Kubernetes Dashboard: configures install
- Cluster operator → Kubeconfig: sets environment (evidence: `README.md`)
- Cluster operator → Kubernetes Dashboard: accesses (evidence: `README.md`)
