Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_k8s-autoscaling-hpa-keda-node-provisioning

Autoscaling on Kubernetes (queue depth, replicas and spot nodes)

13 COMPONENTS · 12 FLOWS · UPDATED 2026-11-21
GITHUB README / PR PREVIEW CARD
[![Autoscaling on Kubernetes (queue depth, replicas and spot nodes) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_k8s-autoscaling-hpa-keda-node-provisioning/opengraph-image)](https://archos.sageideas.dev/d/dgm_k8s-autoscaling-hpa-keda-node-provisioning)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_k8s-autoscaling-hpa-keda-node-provisioning)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_k8s-autoscaling-hpa-keda-node-provisioning" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Autoscaling on Kubernetes (queue depth, replicas and spot nodes) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0[("API Client")]
  rs_1[("Resource server")]
  gw_2["API gateway"]
  queue_3[("Message queue")]
  workers_4["Competing consumers"]
  dlq_5[("Dead-letter queue (DLQ)")]
  as_6["Autoscaler"]
  cluster_7[("Kubernetes cluster")]
  nodeas_8["Autoscaler"]
  secrets_9[("Secrets manager")]
  tsdb_10[("Time-series database (TSDB)")]
  alerting_11[("Alerting")]
  capacity_12["Capacity Estimate"]
  client_0 -->|"1. Calls with a JWT · HTTPS"| gw_2
  gw_2 -->|"2. Enqueues job · HTTPS"| queue_3
  queue_3 -.->|"3a. Delivers job · HTTPS"| workers_4
  queue_3 -.->|"3b. Parks jobs · HTTPS"| dlq_5
  workers_4 -->|"4. Sends result · HTTPS"| rs_1
  as_6 -->|"Polls depth · HTTPS"| queue_3
  as_6 -->|"Sets replicas · HTTPS"| cluster_7
  cluster_7 -->|"Reconciles Pods · HTTPS"| workers_4
  nodeas_8 -->|"Adds nodes · HTTPS"| cluster_7
  secrets_9 -->|"Supplies credential · HTTPS"| nodeas_8
  as_6 -->|"Exports (OTLP) · OTLP"| tsdb_10
  tsdb_10 -->|"Notifies · HTTP"| alerting_11

COMPONENT STACK (12)

  • API ClientSTATEFUL
    Submits jobs from an untrusted network
  • Resource serverSTATEFUL
    Downstream API that receives each result
  • API gatewaySTATELESS
    Checks the JWT; rejects when the queue is full
  • Message queueSTATEFUL
    Holds jobs; hands each to one worker
  • Competing consumersSTATELESS
    Pods that pull jobs; safe to run twice
  • Dead-letter queue (DLQ)STATEFUL
    Parks jobs that keep failing
  • AutoscalerSTATELESS
    Sets the worker count from queue depth
  • Kubernetes clusterSTATEFUL
    Reconciles Pods to the worker count
  • AutoscalerSTATELESS
    Adds spot nodes across pools for Pending Pods
  • Secrets managerSTATEFUL
    Holds the cloud credential for creating nodes
  • Time-series database (TSDB)STATEFUL
    Stores queue depth, Pending Pods, job age
  • AlertingSTATEFUL
    Pages on-call when jobs age or the DLQ grows

REQUEST & DATA FLOW (12)

  1. API Client → API gateway (Calls with a JWT)[HTTPS]
  2. API gateway → Message queue (Enqueues job)[HTTPS]
  3. Message queue → Competing consumers (Delivers job)[HTTPS]
  4. Message queue → Dead-letter queue (DLQ) (Parks jobs)[HTTPS]
  5. Competing consumers → Resource server (Sends result)[HTTPS]
  6. Autoscaler → Message queue (Polls depth)[HTTPS]
  7. Autoscaler → Kubernetes cluster (Sets replicas)[HTTPS]
  8. Kubernetes cluster → Competing consumers (Reconciles Pods)[HTTPS]
  9. Autoscaler → Kubernetes cluster (Adds nodes)[HTTPS]
  10. Secrets manager → Autoscaler (Supplies credential)[HTTPS]
  11. Autoscaler → Time-series database (TSDB) (Exports (OTLP))[OTLP]
  12. Time-series database (TSDB) → Alerting (Notifies)[HTTP]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →