- Collects resource metrics from kubelets
- Exposes metrics through Metrics API
- Required for HPA functionality
- Monitors specified metrics
- Calculates desired replica count
- Adjusts deployment scale
- Runs containerized web server
- Configured with resource constraints
- Scales based on HPA decisions
- Metrics Server collects utilization data
- HPA queries metrics every 15 seconds
- HPA calculates desired replica count
- Deployment scales pods up/down
- Process repeats continuously
- CPU: Target 65% of requested (50m)
Target CPU per pod = 50m * 0.65 = 32.5m
- Memory: Target 1Gi absolute
Scale if: avg_memory_usage > 1Gi
graph TD
A[Metrics Server] -->|Collect Metrics| B[HPA]
B -->|Check Thresholds| C{Scale?}
C -->|Yes| D[Calculate Replicas]
D -->|Update| E[Deployment]
C -->|No| F[Wait 15s]
F -->|Repeat| B