How cigeke/kubernetes-production-deployment works
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.py Flask API · deployment.yaml API Deployment · service.yaml Kubernetes Service · hpa.yaml Horizontal Pod Autoscaler
Components 12
API runtime
- Flask API
app/app.py
Traffic and metrics
- NGINX ingress
k8s/ingress.yaml - Kubernetes Service
k8s/service.yaml
Kubernetes workload
- API Deployment
k8s/deployment.yaml - Production namespace
k8s/namespace.yaml - Horizontal Pod Autoscaler
k8s/hpa.yaml - Metrics Server patch
monitoring/metrics-server-docker-desktop.yaml
Availability and security
- PodDisruptionBudget
k8s/pdb.yaml - Network policy
security/network-policy.yaml
Other components
- API client
- Metrics scraper
- Kubernetes kubelet
Connections 12
- 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