Components
A component is anything an app depends on but doesn't own. Two flavors:
- Kustomize components — pulled in by an app's
kustomization.yamlvia thecomponents:field. Things like a CNPGClusterpatch tuned for one app, a Valkey sidecar, a backupSchedule. - Shared resources — declared once at the cluster level and referenced by many apps. Things like internal
HTTPRoutetargets andStorageClassdefinitions.
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):
| Page | What it composes |
|---|---|
| workspace | Namespace + RBAC stub — pre-condition for every other component |
| app-network-policy | Default-deny NetworkPolicy baseline |
| cnpg | CloudNative-PG Cluster resource with backup hooks |
| mongodb | Single-replica MongoDB StatefulSet |
| valkey | Single-replica Valkey/Redis cache (ephemeral) |
| backups | k8up Schedule pointed at the cluster Restic repo |
| SMTP relay credentials in a uniform shape |
Shared cluster resources (declared once, referenced by many apps):
| Page | What it provides |
|---|---|
| http-internal | Internal Gateway for non-public HTTPRoutes |
| storage | StorageClass 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
- It earns a component when two or more apps would benefit. One-off patches stay inline.
- Declare it under
k8s/components/<cluster>/<name>with its ownkustomization.yaml. - Document it with a
README.mdin that folder — that README is what shows up under "Cluster Deployment" on the component's page (via the partial generator). - Reference it from each consuming app's
kustomization.yaml.