# nataliagranato/kubernetes-troubleshooting architecture

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

- Interactive diagram: https://gitdiagram.com/nataliagranato/kubernetes-troubleshooting
- Repository: https://github.com/nataliagranato/kubernetes-troubleshooting

## Overview

##### Project Type and Purpose
- The project serves as an educational resource for practicing and understanding troubleshooting on Kubernetes clusters.
- It includes practical exercises using kubeadm for cluster setup/removal and workloads that simulate different error cases (e.g., crashing pods, misconfigurations).

##### Analyzing the File Structure
- Top-Level Items: Files like LICENSE, README.md, and documentation (docs folder) indicate general project info and guides.
- Directories:
- The “exercícios” folder is divided into subdirectories:
- “kubeadm”: Contains scripts like controlplane-install.sh, worker-install.sh, and uninstall.sh which are used to set up and dismantle the Kubernetes control plane and worker nodes.
- “workloads”: Contains YAML files that simulate various error scenarios (e.g., bad_prometheus_rule.yaml, failing_liveness_probe.yaml, resource errors, etc.).
- Other Files: Files such as nginx-ingress-bare-metal.yaml might be used to demonstrate load balancing or ingress controller scenarios.
- The “docs” folder contains PDFs and additional markdown resources, which likely provide background and supportive learning material.

##### Main Components
a. Educational Resources & Documentation:
b. Cluster Setup/Management:
- “Kubeadm Scripts”: Two primary components for managing the cluster:
- “Control Plane Setup” (controlplane-install.sh)
- “Worker Install” (worker-install.sh)
- “Uninstallation Script” (uninstall.sh)
c. Workloads and Error Scenarios:
- Pod lifecycle errors (e.g., crashloop, pending resources)
- Configuration errors (e.g., image errors, resource misconfigurations)
- Service errors (e.g., svc-errs.yaml)
d. Cluster Components (Conceptually):
- Standard Kubernetes architecture elements such as “API Server”, “Scheduler”, “Controller Manager”, “etcd”, “Worker Nodes”, and “Pods.”
- This helps bridge the gap between the abstract exercises and the real-world Kubernetes components they affect.

##### Relationships and Interactions
- How the “Kubeadm Scripts” interact with the cluster components to set up the control plane and worker nodes.
- Data flow between the “Documentation” and the exercises, indicating that users refer to guides while applying troubleshooting practices.
- Interaction between an external user (or “student”) and the cluster, representing commands executed via the command-line interface.

##### Architectural Patterns and Design Principles
- The design emphasizes separation of concerns: distinct components for cluster setup (kubeadm scripts) and error simulation (workloads).
- It follows a layered approach, from documentation & exercises down to the underlying Kubernetes cluster components.
- This reinforces learning by mapping scripted exercises to real cluster behavior.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Student("Student/CLI"):::external

    subgraph "Documentation & Guides"
        README["README.md"]:::docs
        PostMortem["Post-Mortem Report"]:::docs
        Docs["Documentation Files"]:::docs
    end

    subgraph "Kubeadm Scripts"
        ControlPlane["Control Plane Setup"]:::kubeadm
        WorkerInstall["Worker Node Install"]:::kubeadm
        Uninstall["Uninstallation Script"]:::kubeadm
    end

    Workloads["Workload Scenarios (Error Simulation)"]:::workloads
    Ingress["Ingress/Load Balancing Example"]:::ingress

    subgraph "Kubernetes Cluster Components"
        API["API Server"]:::k8s
        Scheduler["Scheduler"]:::k8s
        Controller["Controller Manager"]:::k8s
        Etcd["etcd"]:::k8s
        Worker["Worker Nodes"]:::k8s
        Pods["Pods"]:::k8s
    end

    Student -->|"uses"| README
    Student -->|"uses"| PostMortem
    Student -->|"uses"| Docs

    README -->|"guides"| ControlPlane
    PostMortem -->|"guides"| ControlPlane
    Docs -->|"details"| ControlPlane

    Student -->|"executes"| ControlPlane
    Student -->|"executes"| WorkerInstall
    Student -->|"executes"| Uninstall

    ControlPlane -->|"initializes"| API
    ControlPlane -->|"initializes"| Scheduler
    ControlPlane -->|"initializes"| Controller
    ControlPlane -->|"initializes"| Etcd

    WorkerInstall -->|"joins"| Worker
    Worker -->|"hosts"| Pods

    Workloads -->|"deploys"| Pods
    Ingress -->|"routes"| Worker

    ControlPlane ---|"coordinates"| WorkerInstall

    click README "https://github.com/nataliagranato/kubernetes-troubleshooting/blob/main/README.md"
    click PostMortem "https://github.com/nataliagranato/kubernetes-troubleshooting/blob/main/post-mortem-report.md"
    click Docs "https://github.com/nataliagranato/kubernetes-troubleshooting/tree/main/docs/"
    click ControlPlane "https://github.com/nataliagranato/kubernetes-troubleshooting/blob/main/exercicios/kubeadm/controlplane-install.sh"
    click WorkerInstall "https://github.com/nataliagranato/kubernetes-troubleshooting/blob/main/exercicios/kubeadm/worker-install.sh"
    click Uninstall "https://github.com/nataliagranato/kubernetes-troubleshooting/blob/main/exercicios/kubeadm/uninstall.sh"
    click Workloads "https://github.com/nataliagranato/kubernetes-troubleshooting/tree/main/exercicios/workloads"
    click Ingress "https://github.com/nataliagranato/kubernetes-troubleshooting/blob/main/nginx-ingress-bare-metal.yaml"

    classDef external fill:#FFCC00,stroke:#333,stroke-width:2px;
    classDef docs fill:#AED6F1,stroke:#333,stroke-width:2px;
    classDef kubeadm fill:#F9E79F,stroke:#333,stroke-width:2px;
    classDef workloads fill:#D2B4DE,stroke:#333,stroke-width:2px;
    classDef ingress fill:#A3E4D7,stroke:#333,stroke-width:2px;
    classDef k8s fill:#F5B7B1,stroke:#333,stroke-width:2px;
```
