Design
Design patterns and architecture of the Porch API server.
The Porch API Server is a Kubernetes extension API server that exposes Porch’s aggregated API resources (PackageRevision, PackageRevisionResources, Package) and CRDs (Repository, PackageRev) through the Kubernetes API. It acts as the entry point for client interactions with Porch, translating Kubernetes API requests into operations on the underlying Engine and Cache.
The PackageVariant and PackageVariantSet CRDs are not controlled by the Porch API server. They are controlled by the Porch Controllers
The Porch API Server is responsible for:
The Porch API Server sits at the top of the Porch architecture, serving as the interface between Kubernetes clients and Porch’s internal components:
┌────────────────────────────────────────────────────────────┐
│ Porch API Server │
│ │
│ ┌──────────────────┐ ┌────────────────────────────┐ │
│ │ API Groups │ │ REST Storage │ │
│ │ │ ───> │ (Aggregated) │ │
│ │ • porch.kpt.dev │ │ • PackageRevision │ │
│ │ │ │ • PackageRevisionResources│ │
│ │ │ │ • Package │ │
│ └──────────────────┘ └────────────────────────────┘ │
│ │ │ │
│ │ │ │
│ ┌──────────────────┐ │ │
│ │ CRDs (etcd) │ │ │
│ │ │ │ │
│ │ • Repository │ │ │
│ │ • PackageRev │ │ │
│ └──────────────────┘ │ │
│ │ │ │
│ └────────┬────────────────┘ │
│ ↓ │
│ ┌──────────────────┐ ┌──────────────────┐ │
│ │ Strategies │ │ Background │ │
│ │ │ │ Jobs │ │
│ │ • Validation │ │ │ │
│ │ • Admission │ │ • Repo Sync │ │
│ │ • Table Conv │ │ • Cleanup │ │
│ └──────────────────┘ └──────────────────┘ │
└────────────────────────────────────────────────────────────┘
↓
┌──────────────────────┐
│ CaD Engine │
│ (Orchestration) │
└──────────────────────┘
↓
┌──────────────────────┐
│ Package Cache │
│ (Repository Data) │
└──────────────────────┘
Key architectural responsibilities:
The API Server is instantiated once during Porch startup and configured with Engine, Cache, and client connections through dependency injection.
Design patterns and architecture of the Porch API server.
Core functionality provided by the Porch API server.
How the Porch API server interacts with other components.