# quickwork-technologies/knative-serving architecture

> Architecture diagram of the GitHub repository quickwork-technologies/knative-serving, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/quickwork-technologies/knative-serving
- Repository: https://github.com/quickwork-technologies/knative-serving

## Overview

Knative Serving runs serverless containers on Kubernetes. A user creates a Serving Service; reconciliation produces a Configuration and Route, the Configuration snapshots deployment intent into immutable Revisions, and Revision reconciliation provisions workloads and scaling resources. Route and domain-mapping reconciliation program ingress, while the Activator and per-revision queue proxy handle traffic and scale-from-zero behavior. Autoscaling observes request statistics and adjusts capacity; garbage collection removes obsolete revisions. The README documents these capabilities, and the tree identifies the supporting subsystems; detailed implementation wiring beyond the sampled controller and handler code is represented conservatively.

Main entry points: [`pkg/reconciler/service/service.go`](https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/service/service.go) (Service Reconciler), [`pkg/queue/handler.go`](https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/queue/handler.go) (Queue Proxy), [`pkg/reconciler/configuration/configuration.go`](https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/configuration/configuration.go) (Configuration Reconciler), [`pkg/reconciler/revision/revision.go`](https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/revision/revision.go) (Revision Reconciler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Serving API"]
  node_client["Serving Client<br/>[clientset.go]"]
  node_servingapi["Serving Resources<br/>[service_types.go]"]
  node_autoscalingapi["Autoscaling Resources<br/>[pa_types.go]"]
end

subgraph group_reconcile["Resource Reconciliation"]
  node_service["Service Reconciler<br/>[service.go]"]
  node_configuration["Configuration Reconciler<br/>[configuration.go]"]
  node_revision["Revision Reconciler<br/>[revision.go]"]
  node_route["Route Reconciler<br/>[route.go]"]
  node_domainmapping["Domain Mapping<br/>[reconciler.go]"]
  node_deployment["Workload Resources<br/>[deploy.go]"]
  node_ingress["Ingress Resources<br/>[ingress.go]"]
end

subgraph group_traffic["Traffic Serving"]
  node_activator["Activator<br/>[activator.go]"]
  node_context["Request Context<br/>[context_handler.go]"]
  node_queue["Queue Proxy<br/>[handler.go]"]
end

subgraph group_scale["Autoscaling"]
  node_kpa["KPA Reconciler<br/>[kpa.go]"]
  node_metrics["Request Metrics<br/>[collector.go]"]
  node_statserver["Statistics Server<br/>[server.go]"]
  node_hpa["HPA Reconciler<br/>[hpa.go]"]
end

subgraph group_support["Lifecycle Support"]
  node_gc["Revision Garbage Collection<br/>[gc.go]"]
  node_labeler["Route Labeler<br/>[labeler.go]"]
  node_nscert["Namespace Certificates<br/>[nscert.go]"]
end

node_developer(("Application Developer"))
node_kubeapi[("Kubernetes API")]
node_application["Serverless Container"]

node_developer -->|"submits resources"| node_client
node_client -->|"writes resources"| node_kubeapi
node_kubeapi -->|"notifies changes"| node_service
node_kubeapi -->|"notifies changes"| node_configuration
node_kubeapi -->|"notifies changes"| node_revision
node_kubeapi -->|"notifies changes"| node_route
node_service -->|"creates configuration"| node_configuration
node_service -->|"creates route"| node_route
node_configuration -->|"creates revision"| node_revision
node_revision -->|"provisions workload"| node_deployment
node_deployment -->|"writes workload"| node_kubeapi
node_route -->|"programs routing"| node_ingress
node_ingress -->|"writes ingress"| node_kubeapi
node_domainmapping -->|"writes domain resources"| node_kubeapi
node_kubeapi -->|"provides revision state"| node_activator
node_activator -->|"dispatches request"| node_context
node_context -->|"forwards request"| node_queue
node_queue -->|"proxies traffic"| node_application
node_queue -->|"reports statistics"| node_statserver
node_statserver -->|"serves statistics"| node_metrics
node_metrics -->|"provides measurements"| node_kpa
node_kpa -->|"updates capacity"| node_kubeapi
node_hpa -.->|"updates capacity"| node_kubeapi
node_gc -->|"removes obsolete revisions"| node_kubeapi
node_labeler -->|"updates route labels"| node_kubeapi
node_nscert -->|"manages certificates"| node_kubeapi

click node_client "https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/client/clientset/versioned/clientset.go"
click node_servingapi "https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/apis/serving/v1/service_types.go"
click node_autoscalingapi "https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/apis/autoscaling/v1alpha1/pa_types.go"
click node_service "https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/service/service.go"
click node_configuration "https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/configuration/configuration.go"
click node_revision "https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/revision/revision.go"
click node_route "https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/route/route.go"
click node_domainmapping "https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/domainmapping/reconciler.go"
click node_deployment "https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/revision/resources/deploy.go"
click node_ingress "https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/route/resources/ingress.go"
click node_gc "https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/gc/gc.go"
click node_activator "https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/activator/activator.go"
click node_context "https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/activator/handler/context_handler.go"
click node_queue "https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/queue/handler.go"
click node_kpa "https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/autoscaling/kpa/kpa.go"
click node_metrics "https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/autoscaler/metrics/collector.go"
click node_statserver "https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/autoscaler/statserver/server.go"
click node_hpa "https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/autoscaling/hpa/hpa.go"
click node_labeler "https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/labeler/labeler.go"
click node_nscert "https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/nscert/nscert.go"

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_client,node_servingapi,node_autoscalingapi toneBlue
class node_service,node_configuration,node_revision,node_route,node_domainmapping,node_deployment,node_ingress,node_kubeapi toneAmber
class node_activator,node_context,node_queue,node_application toneMint
class node_kpa,node_metrics,node_statserver,node_hpa toneRose
class node_gc,node_labeler,node_nscert,node_developer toneIndigo
```

## Components

### Serving API

- [Serving Client](https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/client/clientset/versioned/clientset.go): `pkg/client/clientset/versioned/clientset.go`
- [Serving Resources](https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/apis/serving/v1/service_types.go): `pkg/apis/serving/v1/service_types.go`
- [Autoscaling Resources](https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/apis/autoscaling/v1alpha1/pa_types.go): `pkg/apis/autoscaling/v1alpha1/pa_types.go`

### Resource Reconciliation

- [Service Reconciler](https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/service/service.go): `pkg/reconciler/service/service.go`
- [Configuration Reconciler](https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/configuration/configuration.go): `pkg/reconciler/configuration/configuration.go`
- [Revision Reconciler](https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/revision/revision.go): `pkg/reconciler/revision/revision.go`
- [Route Reconciler](https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/route/route.go): `pkg/reconciler/route/route.go`
- [Domain Mapping](https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/domainmapping/reconciler.go): `pkg/reconciler/domainmapping/reconciler.go`
- [Workload Resources](https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/revision/resources/deploy.go): `pkg/reconciler/revision/resources/deploy.go`
- [Ingress Resources](https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/route/resources/ingress.go): `pkg/reconciler/route/resources/ingress.go`

### Traffic Serving

- [Activator](https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/activator/activator.go): `pkg/activator/activator.go`
- [Request Context](https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/activator/handler/context_handler.go): `pkg/activator/handler/context_handler.go`
- [Queue Proxy](https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/queue/handler.go): `pkg/queue/handler.go`

### Autoscaling

- [KPA Reconciler](https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/autoscaling/kpa/kpa.go): `pkg/reconciler/autoscaling/kpa/kpa.go`
- [Request Metrics](https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/autoscaler/metrics/collector.go): `pkg/autoscaler/metrics/collector.go`
- [Statistics Server](https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/autoscaler/statserver/server.go): `pkg/autoscaler/statserver/server.go`
- [HPA Reconciler](https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/autoscaling/hpa/hpa.go): `pkg/reconciler/autoscaling/hpa/hpa.go`

### Lifecycle Support

- [Revision Garbage Collection](https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/gc/gc.go): `pkg/reconciler/gc/gc.go`
- [Route Labeler](https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/labeler/labeler.go): `pkg/reconciler/labeler/labeler.go`
- [Namespace Certificates](https://github.com/quickwork-technologies/knative-serving/blob/main/pkg/reconciler/nscert/nscert.go): `pkg/reconciler/nscert/nscert.go`

### Other components

- **Application Developer**
- **Kubernetes API**
- **Serverless Container**

## Connections

- Application Developer → Serving Client: submits resources
- Serving Client → Kubernetes API: writes resources
- Kubernetes API → Service Reconciler: notifies changes
- Kubernetes API → Configuration Reconciler: notifies changes
- Kubernetes API → Revision Reconciler: notifies changes
- Kubernetes API → Route Reconciler: notifies changes
- Service Reconciler → Configuration Reconciler: creates configuration
- Service Reconciler → Route Reconciler: creates route
- Configuration Reconciler → Revision Reconciler: creates revision
- Revision Reconciler → Workload Resources: provisions workload
- Workload Resources → Kubernetes API: writes workload
- Route Reconciler → Ingress Resources: programs routing
- Ingress Resources → Kubernetes API: writes ingress
- Domain Mapping → Kubernetes API: writes domain resources
- Kubernetes API → Activator: provides revision state
- Activator → Request Context: dispatches request
- Request Context → Queue Proxy: forwards request
- Queue Proxy → Serverless Container: proxies traffic
- Queue Proxy → Statistics Server: reports statistics
- Statistics Server → Request Metrics: serves statistics
- Request Metrics → KPA Reconciler: provides measurements
- KPA Reconciler → Kubernetes API: updates capacity
- HPA Reconciler → Kubernetes API: updates capacity
- Revision Garbage Collection → Kubernetes API: removes obsolete revisions
- Route Labeler → Kubernetes API: updates route labels
- Namespace Certificates → Kubernetes API: manages certificates
