# filooww/k8s-gitops-platform architecture

> Architecture diagram of the GitHub repository filooww/k8s-gitops-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/filooww/k8s-gitops-platform
- Repository: https://github.com/filooww/k8s-gitops-platform

## Overview

This repository is a Kubernetes GitOps platform for deploying and operating a FastAPI demo service. The main path runs from a Git change through CI image publication and manifest update, then Argo CD reconciliation and Helm deployment; users reach the app through ingress. Monitoring, alerting, sealed-secret decryption, load-driven autoscaling, and optional Terraform provisioning are distinct operational branches. The app and load-test behavior are supported by sampled source; deployment and monitoring relationships are based on the README and repository layout, so unsampled internal wiring is kept high-level.

Main entry points: [`monitoring/values.yaml`](https://github.com/filooww/k8s-gitops-platform/blob/main/monitoring/values.yaml) (Prometheus Stack), [`charts/myapp/templates/deployment.yaml`](https://github.com/filooww/k8s-gitops-platform/blob/main/charts/myapp/templates/deployment.yaml) (App Deployment), [`argocd/apps/myapp.yaml`](https://github.com/filooww/k8s-gitops-platform/blob/main/argocd/apps/myapp.yaml) (Myapp Argo App), [`.github/workflows/ci.yaml`](https://github.com/filooww/k8s-gitops-platform/blob/main/.github/workflows/ci.yaml) (CI Workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_app["FastAPI Service<br/>[main.py]"]
end

subgraph group_gitops["GitOps Delivery"]
  node_ingress["Ingress<br/>[ingress.yaml]"]
  node_service["Kubernetes Service<br/>[service.yaml]"]
  node_deployment["App Deployment<br/>[deployment.yaml]"]
  node_helm["Myapp Helm Chart"]
  node_argoroot["Argo CD Root App<br/>[root-app.yaml]"]
  node_argomyapp["Myapp Argo App<br/>[myapp.yaml]"]
  node_ci["CI Workflow<br/>[ci.yaml]"]
end

subgraph group_operations["Operations"]
  node_loadtest["k6 Load Test<br/>[script.js]"]
  node_prometheus["Prometheus Stack<br/>[values.yaml]"]
  node_servicemonitor["ServiceMonitor"]
  node_promrule["Prometheus Alerts"]
  node_grafana["Grafana Dashboard"]
  node_alertmanager["Alertmanager Telegram"]
  node_hpa["CPU Autoscaler<br/>[hpa.yaml]"]
  node_sealed["Sealed Secrets Controller"]
  node_sealedmanifest["Sealed Secret Manifest<br/>[sealedsecret.yaml]"]
end

subgraph group_cloud["Cloud Provisioning"]
  node_terraform["Terraform Provisioning<br/>[main.tf]"]
end

node_user(("App User"))
node_git[("Git Repository")]
node_ghcr[("GHCR")]
node_metricsserver["Metrics Server"]
node_ec2["EC2 k3s Host"]

node_user -->|"requests app"| node_ingress
node_ingress -->|"routes traffic"| node_service
node_service -->|"selects pods"| node_deployment
node_deployment -->|"runs service"| node_app
node_app -->|"exposes metrics"| node_prometheus
node_prometheus -->|"scrapes target"| node_servicemonitor
node_prometheus -->|"supplies metrics"| node_grafana
node_promrule -->|"defines alerts"| node_prometheus
node_prometheus -->|"routes alerts"| node_alertmanager
node_loadtest -->|"sends /work load"| node_ingress
node_metricsserver -->|"provides CPU metrics"| node_hpa
node_hpa -->|"scales replicas"| node_deployment
node_sealedmanifest -->|"decrypted by"| node_sealed
node_sealed -->|"creates Secret"| node_deployment
node_git -->|"triggers workflow"| node_ci
node_ci -->|"pushes image"| node_ghcr
node_ci -->|"updates image tag"| node_git
node_argoroot -->|"reconciles app"| node_argomyapp
node_argomyapp -->|"reads manifests"| node_git
node_argomyapp -->|"deploys chart"| node_helm
node_helm -->|"renders resources"| node_deployment
node_terraform -.->|"provisions host"| node_ec2

click node_loadtest "https://github.com/filooww/k8s-gitops-platform/blob/main/loadtest/script.js"
click node_app "https://github.com/filooww/k8s-gitops-platform/blob/main/app/main.py"
click node_ingress "https://github.com/filooww/k8s-gitops-platform/blob/main/charts/myapp/templates/ingress.yaml"
click node_service "https://github.com/filooww/k8s-gitops-platform/blob/main/charts/myapp/templates/service.yaml"
click node_deployment "https://github.com/filooww/k8s-gitops-platform/blob/main/charts/myapp/templates/deployment.yaml"
click node_helm "https://github.com/filooww/k8s-gitops-platform/tree/main/charts/myapp"
click node_argoroot "https://github.com/filooww/k8s-gitops-platform/blob/main/argocd/root-app.yaml"
click node_argomyapp "https://github.com/filooww/k8s-gitops-platform/blob/main/argocd/apps/myapp.yaml"
click node_ci "https://github.com/filooww/k8s-gitops-platform/blob/main/.github/workflows/ci.yaml"
click node_prometheus "https://github.com/filooww/k8s-gitops-platform/blob/main/monitoring/values.yaml"
click node_servicemonitor "https://github.com/filooww/k8s-gitops-platform/blob/main/charts/myapp/templates/servicemonitor.yaml"
click node_promrule "https://github.com/filooww/k8s-gitops-platform/blob/main/charts/myapp/templates/prometheusrule.yaml"
click node_grafana "https://github.com/filooww/k8s-gitops-platform/blob/main/charts/myapp/dashboards/myapp-dashboard.json"
click node_alertmanager "https://github.com/filooww/k8s-gitops-platform/blob/main/monitoring/alertmanager-telegram.yaml"
click node_hpa "https://github.com/filooww/k8s-gitops-platform/blob/main/charts/myapp/templates/hpa.yaml"
click node_sealed "https://github.com/filooww/k8s-gitops-platform/blob/main/argocd/apps/sealed-secrets.yaml"
click node_sealedmanifest "https://github.com/filooww/k8s-gitops-platform/blob/main/charts/myapp/templates/sealedsecret.yaml"
click node_terraform "https://github.com/filooww/k8s-gitops-platform/blob/main/terraform/main.tf"

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_app,node_user toneBlue
class node_ingress,node_service,node_deployment,node_helm,node_argoroot,node_argomyapp,node_ci,node_git,node_ghcr toneAmber
class node_loadtest,node_prometheus,node_servicemonitor,node_promrule,node_grafana,node_alertmanager,node_hpa,node_sealed,node_sealedmanifest,node_metricsserver toneMint
class node_terraform toneRose
class node_ec2 toneIndigo
```

## Components

### Application

- [FastAPI Service](https://github.com/filooww/k8s-gitops-platform/blob/main/app/main.py): `app/main.py`

### GitOps Delivery

- [Ingress](https://github.com/filooww/k8s-gitops-platform/blob/main/charts/myapp/templates/ingress.yaml): `charts/myapp/templates/ingress.yaml`
- [Kubernetes Service](https://github.com/filooww/k8s-gitops-platform/blob/main/charts/myapp/templates/service.yaml): `charts/myapp/templates/service.yaml`
- [App Deployment](https://github.com/filooww/k8s-gitops-platform/blob/main/charts/myapp/templates/deployment.yaml): `charts/myapp/templates/deployment.yaml`
- [Myapp Helm Chart](https://github.com/filooww/k8s-gitops-platform/tree/main/charts/myapp): `charts/myapp`
- [Argo CD Root App](https://github.com/filooww/k8s-gitops-platform/blob/main/argocd/root-app.yaml): `argocd/root-app.yaml`
- [Myapp Argo App](https://github.com/filooww/k8s-gitops-platform/blob/main/argocd/apps/myapp.yaml): `argocd/apps/myapp.yaml`
- [CI Workflow](https://github.com/filooww/k8s-gitops-platform/blob/main/.github/workflows/ci.yaml): `.github/workflows/ci.yaml`

### Operations

- [k6 Load Test](https://github.com/filooww/k8s-gitops-platform/blob/main/loadtest/script.js): `loadtest/script.js`
- [Prometheus Stack](https://github.com/filooww/k8s-gitops-platform/blob/main/monitoring/values.yaml): `monitoring/values.yaml`
- [ServiceMonitor](https://github.com/filooww/k8s-gitops-platform/blob/main/charts/myapp/templates/servicemonitor.yaml): `charts/myapp/templates/servicemonitor.yaml`
- [Prometheus Alerts](https://github.com/filooww/k8s-gitops-platform/blob/main/charts/myapp/templates/prometheusrule.yaml): `charts/myapp/templates/prometheusrule.yaml`
- [Grafana Dashboard](https://github.com/filooww/k8s-gitops-platform/blob/main/charts/myapp/dashboards/myapp-dashboard.json): `charts/myapp/dashboards/myapp-dashboard.json`
- [Alertmanager Telegram](https://github.com/filooww/k8s-gitops-platform/blob/main/monitoring/alertmanager-telegram.yaml): `monitoring/alertmanager-telegram.yaml`
- [CPU Autoscaler](https://github.com/filooww/k8s-gitops-platform/blob/main/charts/myapp/templates/hpa.yaml): `charts/myapp/templates/hpa.yaml`
- [Sealed Secrets Controller](https://github.com/filooww/k8s-gitops-platform/blob/main/argocd/apps/sealed-secrets.yaml): `argocd/apps/sealed-secrets.yaml`
- [Sealed Secret Manifest](https://github.com/filooww/k8s-gitops-platform/blob/main/charts/myapp/templates/sealedsecret.yaml): `charts/myapp/templates/sealedsecret.yaml`

### Cloud Provisioning

- [Terraform Provisioning](https://github.com/filooww/k8s-gitops-platform/blob/main/terraform/main.tf): `terraform/main.tf`

### Other components

- **App User**
- **Git Repository**
- **GHCR**
- **Metrics Server**
- **EC2 k3s Host**

## Connections

- App User → Ingress: requests app
- Ingress → Kubernetes Service: routes traffic
- Kubernetes Service → App Deployment: selects pods
- App Deployment → FastAPI Service: runs service
- FastAPI Service → Prometheus Stack: exposes metrics
- Prometheus Stack → ServiceMonitor: scrapes target
- Prometheus Stack → Grafana Dashboard: supplies metrics
- Prometheus Alerts → Prometheus Stack: defines alerts
- Prometheus Stack → Alertmanager Telegram: routes alerts
- k6 Load Test → Ingress: sends /work load
- Metrics Server → CPU Autoscaler: provides CPU metrics
- CPU Autoscaler → App Deployment: scales replicas
- Sealed Secret Manifest → Sealed Secrets Controller: decrypted by
- Sealed Secrets Controller → App Deployment: creates Secret
- Git Repository → CI Workflow: triggers workflow
- CI Workflow → GHCR: pushes image
- CI Workflow → Git Repository: updates image tag
- Argo CD Root App → Myapp Argo App: reconciles app
- Myapp Argo App → Git Repository: reads manifests
- Myapp Argo App → Myapp Helm Chart: deploys chart
- Myapp Helm Chart → App Deployment: renders resources
- Terraform Provisioning → EC2 k3s Host: provisions host
