# cigeke/kubernetes-production-deployment architecture

> Architecture diagram of the GitHub repository cigeke/kubernetes-production-deployment, 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/cigeke/kubernetes-production-deployment
- Repository: https://github.com/cigeke/kubernetes-production-deployment

## Overview

This repository packages a small Flask platform API and deploys it to Kubernetes. The main workflow is a client request entering through ingress or port forwarding, reaching the Kubernetes Service and API, and receiving a response. Kubernetes deployment resources add health checks, autoscaling, disruption protection, and network restrictions; the API also exposes Prometheus metrics. The README documents these deployment capabilities, but most manifest contents were not sampled, so the graph shows only documented relationships.

Main entry points: [`app/app.py`](https://github.com/cigeke/kubernetes-production-deployment/blob/main/app/app.py) (Flask API), [`k8s/deployment.yaml`](https://github.com/cigeke/kubernetes-production-deployment/blob/main/k8s/deployment.yaml) (API Deployment), [`k8s/service.yaml`](https://github.com/cigeke/kubernetes-production-deployment/blob/main/k8s/service.yaml) (Kubernetes Service), [`k8s/hpa.yaml`](https://github.com/cigeke/kubernetes-production-deployment/blob/main/k8s/hpa.yaml) (Horizontal Pod Autoscaler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API runtime"]
  node_api["Flask API<br/>[app.py]"]
end

subgraph group_traffic["Traffic and metrics"]
  node_ingress["NGINX ingress<br/>[ingress.yaml]"]
  node_service["Kubernetes Service<br/>[service.yaml]"]
end

subgraph group_cluster["Kubernetes workload"]
  node_deployment["API Deployment<br/>[deployment.yaml]"]
  node_namespace["Production namespace<br/>[namespace.yaml]"]
  node_hpa["Horizontal Pod Autoscaler<br/>[hpa.yaml]"]
  node_metricsserver["Metrics Server patch"]
end

subgraph group_policy["Availability and security"]
  node_pdb["PodDisruptionBudget<br/>[pdb.yaml]"]
  node_networkpolicy["Network policy"]
end

node_client(("API client"))
node_scraper(("Metrics scraper"))
node_kubelet(("Kubernetes kubelet"))

node_client -->|"requests"| node_ingress
node_ingress -->|"routes"| node_service
node_client -.->|"port-forwards"| node_service
node_service -->|"routes"| node_api
node_api -->|"returns JSON"| node_client
node_scraper -.->|"scrapes metrics"| node_api
node_deployment -->|"runs pods"| node_api
node_kubelet -->|"probes health"| node_api
node_hpa -->|"reads metrics"| node_metricsserver
node_hpa -->|"scales"| node_deployment
node_pdb -->|"limits disruptions"| node_deployment
node_networkpolicy -->|"restricts traffic"| node_deployment

click node_api "https://github.com/cigeke/kubernetes-production-deployment/blob/main/app/app.py"
click node_ingress "https://github.com/cigeke/kubernetes-production-deployment/blob/main/k8s/ingress.yaml"
click node_service "https://github.com/cigeke/kubernetes-production-deployment/blob/main/k8s/service.yaml"
click node_deployment "https://github.com/cigeke/kubernetes-production-deployment/blob/main/k8s/deployment.yaml"
click node_namespace "https://github.com/cigeke/kubernetes-production-deployment/blob/main/k8s/namespace.yaml"
click node_hpa "https://github.com/cigeke/kubernetes-production-deployment/blob/main/k8s/hpa.yaml"
click node_metricsserver "https://github.com/cigeke/kubernetes-production-deployment/blob/main/monitoring/metrics-server-docker-desktop.yaml"
click node_pdb "https://github.com/cigeke/kubernetes-production-deployment/blob/main/k8s/pdb.yaml"
click node_networkpolicy "https://github.com/cigeke/kubernetes-production-deployment/blob/main/security/network-policy.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_api,node_client toneBlue
class node_ingress,node_service toneAmber
class node_deployment,node_namespace,node_hpa,node_metricsserver toneMint
class node_pdb,node_networkpolicy toneRose
class node_scraper,node_kubelet toneIndigo
```

## Components

### API runtime

- [Flask API](https://github.com/cigeke/kubernetes-production-deployment/blob/main/app/app.py): `app/app.py`

### Traffic and metrics

- [NGINX ingress](https://github.com/cigeke/kubernetes-production-deployment/blob/main/k8s/ingress.yaml): `k8s/ingress.yaml`
- [Kubernetes Service](https://github.com/cigeke/kubernetes-production-deployment/blob/main/k8s/service.yaml): `k8s/service.yaml`

### Kubernetes workload

- [API Deployment](https://github.com/cigeke/kubernetes-production-deployment/blob/main/k8s/deployment.yaml): `k8s/deployment.yaml`
- [Production namespace](https://github.com/cigeke/kubernetes-production-deployment/blob/main/k8s/namespace.yaml): `k8s/namespace.yaml`
- [Horizontal Pod Autoscaler](https://github.com/cigeke/kubernetes-production-deployment/blob/main/k8s/hpa.yaml): `k8s/hpa.yaml`
- [Metrics Server patch](https://github.com/cigeke/kubernetes-production-deployment/blob/main/monitoring/metrics-server-docker-desktop.yaml): `monitoring/metrics-server-docker-desktop.yaml`

### Availability and security

- [PodDisruptionBudget](https://github.com/cigeke/kubernetes-production-deployment/blob/main/k8s/pdb.yaml): `k8s/pdb.yaml`
- [Network policy](https://github.com/cigeke/kubernetes-production-deployment/blob/main/security/network-policy.yaml): `security/network-policy.yaml`

### Other components

- **API client**
- **Metrics scraper**
- **Kubernetes kubelet**

## Connections

- API client → NGINX ingress: requests
- NGINX ingress → Kubernetes Service: routes
- API client → Kubernetes Service: port-forwards
- Kubernetes Service → Flask API: routes
- Flask API → API client: returns JSON
- Metrics scraper → Flask API: scrapes metrics
- API Deployment → Flask API: runs pods
- Kubernetes kubelet → Flask API: probes health
- Horizontal Pod Autoscaler → Metrics Server patch: reads metrics
- Horizontal Pod Autoscaler → API Deployment: scales
- PodDisruptionBudget → API Deployment: limits disruptions
- Network policy → API Deployment: restricts traffic
