Skip to main content

Components

A component is anything an app depends on but doesn't own. Two flavors:

  • Kustomize components — pulled in by an app's kustomization.yaml via the components: field. Things like a CNPG Cluster patch tuned for one app, a Valkey sidecar, a backup Schedule.
  • Shared resources — declared once at the cluster level and referenced by many apps. Things like internal HTTPRoute targets and StorageClass definitions.

Both fit one mental model: primitive an app composes with, not state the app maintains itself. So they live in one section, each with its own page.

Building blocks​

Kustomize components (composable patches an app pulls in):

PageWhat it composes
workspaceTofuWorkspace CR — per-app backup buckets, Backblaze keys, internal DNS
app-network-policyDefault-deny NetworkPolicy baseline
cnpgCloudNative-PG Cluster resource with backup hooks
mongodbSingle-replica MongoDB StatefulSet
minioSingle-node S3 object store (SILO, the MinIO fork) on encrypted Longhorn
valkeySingle-replica Valkey/Redis cache (ephemeral)
natsSingle-node NATS with JetStream on an encrypted Longhorn volume
backupsk8up Schedule pointed at the cluster Restic repo
backups-cnpgk8up PreBackupPod that pg_dumps the app's CNPG cluster into the same snapshot
emailSMTP relay credentials in a uniform shape

Shared cluster resources (declared once, referenced by many apps):

PageWhat it provides
http-internalInternal Gateway for non-public HTTPRoutes
storageStorageClass catalogue (Longhorn variants + NFS)

How an app uses a component​

# k8s/apps/<app>/talos/kustomization.yaml
components:
- ../../../components/workspace/talos
- ../../../components/cnpg/talos
- ../../../components/backups/talos
- ../../../components/app-network-policy/talos

The component overlays its own resources on top of the base manifests. Platform controllers like CNPG and k8up then reconcile what the components declared.

Adding a new component​

  1. It earns a component when two or more apps would benefit. One-off patches stay inline.
  2. Declare it under k8s/components/<name>/<cluster> with its own kustomization.yaml.
  3. Document it with a README.md in that folder — that README is what shows up under "Cluster Deployment" on the component's page (via the partial generator).
  4. Reference it from each consuming app's kustomization.yaml.