# eryx0/fanapcampus-ansible-kubeadm architecture

> Architecture diagram of the GitHub repository eryx0/fanapcampus-ansible-kubeadm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/eryx0/fanapcampus-ansible-kubeadm
- Repository: https://github.com/eryx0/fanapcampus-ansible-kubeadm

## Overview

##### Main Components
- Ansible Playbook: At the top level, you have a playbook (playbook.yaml) that orchestrates the execution of various roles.
- Roles/Modules: The project contains several specially named directories:
- prerequisites – likely handling the installation of necessary packages and ensuring system preconditions.
- cluster-init – responsible for beginning the cluster initialization process.
- kubeadm – managing the core kubeadm commands to actually create or bootstrap the Kubernetes control plane.
- node-join – for roles where worker nodes join the initialized Kubernetes cluster.
- Ancillary Files: Each role has its own README, meta, and tasks directories that define metadata (like dependencies or variables) and the specific steps (tasks) to run.

##### Component Interactions
- Prerequisites
- Cluster Initialization (cluster-init)
- Kubeadm execution (kubeadm)
- Node joining (node-join)
- That the “prerequisites” role must complete before the cluster initialization begins.

##### Architectural Patterns and Design Principles
- Modularity: Emphasize that each role (prerequisites, cluster-init, kubeadm, node-join) encapsulates a focused set of responsibilities.
- Sequential Flow: Illustrate the dependency and sequential order (likely prerequisites → cluster-init → kubeadm → node-join) as these steps must occur in order to successfully initialize the Kubernetes cluster.
- Reusability & Extensibility: Mention that the roles’ separation via individual directories and task files allows for easy updates or extensions.

##### Relevant Technologies
- Ansible: The backbone for task orchestration.
- Kubeadm: The tool used for bootstrapping the Kubernetes cluster.
- Kubernetes: The ultimate target system.
- YAML: The configuration format (as seen in all task files and playbooks).

## Diagram (Mermaid)

```mermaid
flowchart TD
    Playbook["Ansible Playbook (playbook.yaml)"]:::playbook
    Prereq["Prerequisites Role – Ensures environment readiness"]:::role
    ClusterInit["Cluster Initialization Role – Begins cluster setup"]:::role
    Kubeadm["Kubeadm Role – Bootstraps control plane"]:::role
    NodeJoin["Node Join Role – Integrates worker nodes"]:::role

    Playbook -->|"orchestrates"| Prereq
    Prereq -->|"triggers"| ClusterInit
    ClusterInit -->|"initiates"| Kubeadm
    Kubeadm -->|"activates"| NodeJoin

    click Playbook "https://github.com/eryx0/fanapcampus-ansible-kubeadm/blob/main/playbook.yaml"
    click Prereq "https://github.com/eryx0/fanapcampus-ansible-kubeadm/tree/main/prerequisites/"
    click ClusterInit "https://github.com/eryx0/fanapcampus-ansible-kubeadm/tree/main/cluster-init/"
    click Kubeadm "https://github.com/eryx0/fanapcampus-ansible-kubeadm/tree/main/kubeadm/"
    click NodeJoin "https://github.com/eryx0/fanapcampus-ansible-kubeadm/tree/main/node-join/"

    classDef playbook fill:#cfe2f3,stroke:#1f497d,stroke-width:2px;
    classDef role fill:#d9ead3,stroke:#38761d,stroke-width:2px;
```
