The platform uses Kubernetes Horizontal Pod Autoscaler (HPA) for msvc-usuarios and msvc-cursos to respond automatically to CPU demand, and an NGINX Ingress with rate limiting to protect both services from traffic spikes. Together they ensure the system scales out gracefully under load while still rejecting abusive request patterns at the edge.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Miguel-Rodriguez15/msvc/llms.txt
Use this file to discover all available pages before exploring further.
Horizontal Pod Autoscaler
HPA Configuration
Both HPA resources are defined usingautoscaling/v2 and target CPU utilisation:
| Setting | msvc-usuarios | msvc-cursos |
|---|---|---|
| API version | autoscaling/v2 | autoscaling/v2 |
| Minimum replicas | 1 | 1 |
| Maximum replicas | 5 | 5 |
| CPU target (avg utilisation) | 50% | 50% |
400m per pod, the HPA begins scaling out when a pod’s average CPU consumption reaches approximately 200m. It scales back in when utilisation drops back below the threshold, subject to the default stabilisation window.
HPA Manifest
The two HPA resources are identical in structure — only thename and scaleTargetRef.name differ:
msvc-cursos, the manifest is the same with name: hpa-msvc-cursos and scaleTargetRef.name: msvc-cursos.
Monitoring Autoscaling
TARGETS column in kubectl get hpa shows <current>/<target> CPU utilisation. It will display <unknown> until the Metrics Server has collected at least one scrape interval of data.
HPA requires the Metrics Server to be running in the cluster. On Minikube, enable it with:On a managed cluster (GKE, EKS, AKS), the Metrics Server is typically pre-installed. Verify with
kubectl top pods.NGINX Ingress
Ingress Rules
All external HTTP traffic enters the cluster at the hostnamemicroservicios.local. The Ingress routes requests to the correct backend service based on the path prefix:
| Path | Backend Service | Port |
|---|---|---|
/usuarios | msvc-usuarios | 8001 |
/cursos | msvc-cursos | 8002 |
rewrite-target: / annotation strips the path prefix before forwarding to the backend, so a request to http://microservicios.local/usuarios/1 reaches msvc-usuarios as GET /1.
Rate Limiting Annotations
The Ingress applies per-IP rate limiting to both routes using the following annotations fromingress.yaml:
| Annotation | Value | Description |
|---|---|---|
nginx.ingress.kubernetes.io/limit-rps | 10 | Maximum 10 requests per second per source IP |
nginx.ingress.kubernetes.io/limit-connections | 5 | Maximum 5 concurrent connections per source IP |
nginx.ingress.kubernetes.io/limit-req-status-code | 429 | HTTP status code returned when the rate limit is exceeded |
nginx.ingress.kubernetes.io/limit-burst-multiplier | 3 | Burst factor — allows up to 30 RPS momentarily before throttling kicks in |
nginx.ingress.kubernetes.io/rewrite-target | / | Strips the path prefix (/usuarios, /cursos) before forwarding to the backend |
Ingress Manifest
Enable NGINX Ingress in Minikube
ingress-nginx-controller-* pod is in Running state before applying ingress.yaml.
After the Ingress resource is created, add the Minikube node IP to your local /etc/hosts file so the microservicios.local hostname resolves: