Porch Controllers

Configure the Porch controllers component

The Porch controllers manage Repository synchronization, PackageVariants, and PackageVariantSets.

Enabling Controllers

Command Line Arguments

The controllers support these command line arguments:

args:
- --reconcilers=repositories,packagevariants,packagevariantsets  # Comma-separated list
# OR use --reconcilers=* to enable all controllers

Repository Controller Configuration

The Repository Controller supports these additional flags:

args:
- --reconcilers=repositories
- --repositories.max-concurrent-reconciles=100
- --repositories.max-concurrent-syncs=50
- --repositories.health-check-frequency=5m
- --repositories.full-sync-frequency=1h
- --repositories.cache-type=CR  # or DB

Configuration Parameters:

ParameterDefaultDescription
max-concurrent-reconciles100Parallel reconcile loops
max-concurrent-syncs50Parallel sync operations
health-check-frequency5mLightweight connectivity checks
full-sync-frequency1hComplete repository sync
cache-typeCRCache implementation (CR or DB) - see Cache Configuration

Cache Type:

The cache-type parameter determines how package data is stored:

  • CR: Custom Resources for metadata, in-memory caching (simpler, no database required)
  • DB: PostgreSQL database for metadata and content (production-grade, scalable)

Tuning Guidance:

Adjust these parameters based on your deployment characteristics:

  • Concurrency settings (max-concurrent-reconciles, max-concurrent-syncs):

    • Higher values increase throughput but consume more resources
    • Start with defaults and adjust based on observed CPU/memory usage
    • Monitor controller logs for reconciliation delays
  • Frequency settings (health-check-frequency, full-sync-frequency):

    • More frequent checks detect issues faster but increase load
    • Less frequent checks reduce overhead but delay change detection
    • Balance based on your tolerance for sync lag vs resource usage

For detailed sync behavior and scheduling, see Repository Sync Configuration.

PackageRevision Controller Configuration

The PR Controller is enabled by adding packagerevisions to the --reconcilers flag:

args:
- --reconcilers=repositories,packagerevisions
- --packagerevisions.max-concurrent-reconciles=50
- --packagerevisions.max-concurrent-renders=20
- --packagerevisions.render-requeue-delay=2s
- --packagerevisions.repo-operation-retry-attempts=3
- --packagerevisions.max-grpc-message-size=6291456

Configuration Parameters:

ParameterDefaultDescription
max-concurrent-reconciles50Maximum parallel reconciles
max-concurrent-renders20Maximum parallel render operations
render-requeue-delay2sDelay before requeue when render concurrency limit is reached
repo-operation-retry-attempts3Retry count for git operations on transient failures
max-grpc-message-size6MBMaximum gRPC message size for function runner communication

Environment Variables:

VariableRequiredDescription
FUNCTION_RUNNER_ADDRESSFor external functionsgRPC address of the function runner service. If unset, only builtin Go functions are available.

Prerequisites:

The PR Controller requires:

  • The Repository Controller to be running (provides the shared cache)
  • The PackageRevision CRD (porch.kpt.dev/v1alpha2) to be installed in the cluster
  • The function runner service to be reachable (if external KRM functions are used)

Tuning Guidance:

  • Render concurrency: Controls how many packages can be rendered simultaneously. Rendering involves gRPC calls to the function runner, which is CPU and memory intensive. If the function runner is under-provisioned, reduce this limit. If you see frequent RequeueAfter from render throttling, increase it.

  • Reconcile concurrency: Controls total parallel work. Source execution and lifecycle transitions are lightweight, so the bottleneck is usually rendering. A ratio of 2-3x reconciles to renders (e.g. 50 reconciles, 20 renders) works well for most clusters.

  • gRPC message size: Increase this if packages contain large resource files (over 6MB total). This is uncommon for typical KRM packages.

Last modified July 1, 2026: Rewrite and restructuring (f5d243d)