How filooww/k8s-gitops-platform works
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: values.yaml Prometheus Stack · deployment.yaml App Deployment · myapp.yaml Myapp Argo App · ci.yaml CI Workflow
Components 23
Application
- FastAPI Service
app/main.py
GitOps Delivery
- Ingress
charts/myapp/templates/ingress.yaml - Kubernetes Service
charts/myapp/templates/service.yaml - App Deployment
charts/myapp/templates/deployment.yaml - Myapp Helm Chart
charts/myapp - Argo CD Root App
argocd/root-app.yaml - Myapp Argo App
argocd/apps/myapp.yaml - CI Workflow
.github/workflows/ci.yaml
Operations
- k6 Load Test
loadtest/script.js - Prometheus Stack
monitoring/values.yaml - ServiceMonitor
charts/myapp/templates/servicemonitor.yaml - Prometheus Alerts
charts/myapp/templates/prometheusrule.yaml - Grafana Dashboard
charts/myapp/dashboards/myapp-dashboard.json - Alertmanager Telegram
monitoring/alertmanager-telegram.yaml - CPU Autoscaler
charts/myapp/templates/hpa.yaml - Sealed Secrets Controller
argocd/apps/sealed-secrets.yaml - Sealed Secret Manifest
charts/myapp/templates/sealedsecret.yaml
Cloud Provisioning
- Terraform Provisioning
terraform/main.tf
Other components
- App User
- Git Repository
- GHCR
- Metrics Server
- EC2 k3s Host
Connections 22
- 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