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
workspaceNamespace + RBAC stub — pre-condition for every other component
app-network-policyDefault-deny NetworkPolicy baseline
cnpgCloudNative-PG Cluster resource with backup hooks
mongodbSingle-replica MongoDB StatefulSet
valkeySingle-replica Valkey/Redis cache (ephemeral)
backupsk8up Schedule pointed at the cluster Restic repo
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/talos/<app>/kustomization.yaml
components:
- ../../../components/talos/workspace
- ../../../components/talos/cnpg
- ../../../components/talos/backups
- ../../../components/talos/app-network-policy

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/<cluster>/<name> 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.