GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||
GeezerVison is showing gitlab-org.gitlab.io — Composition Composition CompositionCaproni supports composing configuration from multiple files so you can keep a shared base config in version control while maintaining machine-specific or personal overrides locally. Local overrides with |
| Type | Behaviour |
|---|---|
| Maps | Merged recursively — overlay keys add to or replace base keys |
| Scalars | Overlay wins |
null value | Overlay entries remove the key from the merged result |
lifecycle_hooks slices | Overlay entries are appended after base entries |
cluster.network.additional_hostnames slices | Overlay entries are appended after base entries |
dynamic_overrides slices | Overlay entries are appended after base entries |
| All other slices | Overlay replaces base entirely |
This means you only need to specify the keys you want to change — the rest of your base config is preserved.
Because dynamic_overrides entries accumulate, a fragment contributes the Helm values it cares
about and the base config’s overrides survive. A later entry wins on a shared key, and a null
value drops one so the chart default applies again. For details, see
the deploy command.
Base caproni.yaml (committed):
version: 2
cluster:
driver: auto
colima:
memory: 8GiB
cores: 4
k3d:
agents: 0
servers: 1Personal caproni.local.yaml (not committed):
cluster:
colima:
memory: 16GiB
cores: 8Effective configuration after merge:
version: 2
cluster:
driver: auto # preserved from base
colima:
memory: 16GiB # overridden
cores: 8 # overridden
k3d: # preserved from base
agents: 0
servers: 1extends:
Use extends: in caproni.yaml to pull in committed fragment files that add repositories,
reloaders, or other configuration to the base. Fragments are merged left to right, and the
base config always wins on conflicts.
# caproni.yaml
version: 2
extends:
- caproni.ai-gateway.yaml # adds AI Gateway repo, reloader, deployer
- services/caproni.valkey.yaml # adds Valkey deployer from a subdirectory
cluster:
driver: auto
# ...
repositories:
myapp:
repository: https://github.com/example/myapp.git
directory: ./myapp/Fragment files follow the caproni.<name>.yaml naming convention. They contain partial
configuration — only the keys you want to add or override:
# caproni.ai-gateway.yaml
repositories:
ai-gateway:
repository: https://github.com/example/ai-gateway.git
directory: ./ai-gateway/
reloaders:
ai-gateway:
type: mirror
repository: ai-gateway
edit_mode: false
mirror:
target:
namespace: ai-gateway
kubernetes_type: deployment
name: ai-gateway
edit_mode_processes:
server:
command: poetry run ai_gatewayFragment files must not contain extends: themselves. Fragments are stored alongside
caproni.yaml or in subdirectories when they have supporting files (Helm values, README):
project/
├── caproni.yaml
├── caproni.ai-gateway.yaml
└── services/
├── caproni.valkey.yaml
└── values.yamlWhen you fetch a fragment over HTTPS, file paths in the config are downloaded from the fragment’s location, not your local project.
Directories can’t be fetched over HTTPS, so a remote fragment must not reference one. This rules
out gitlab_repo_version_files, and a Kustomize deployer whose path points at a directory:
# Rejected in a remote fragment: ./overlays is a directory on the fragment's host.
deployers:
my-overlay:
type: kustomize
kustomize:
path: ./overlays/devOverriding kustomize.path for that deployer from a higher-precedence layer lifts the restriction:
your own caproni.yaml, a local fragment listed after it in extends:, or caproni.local.yaml.
The override is yours, so it resolves relative to that file’s directory like any local deployer.
A Kustomize deployer whose path uses the builtin: scheme is supported, because the scheme names
an overlay embedded in the caproni binary rather than a directory to fetch:
# Supported in a remote fragment: nothing is fetched from the fragment's location.
deployers:
caproni-dev-ca:
type: kustomize
kustomize:
path: builtin:dev-caA Kustomize deployer whose path is a
remote target is also supported:
deployers:
shared-overlay:
type: kustomize
kustomize:
path: https://gitlab.com/org/infra.git//overlays/dev?ref=v1.2.0Example:
If your remote fragment is at https://example.com/services/caproni.frag.yaml and defines:
deployers:
artifact-registry:
type: helm
helm:
namespace: artifact-registry
values_file: ./caproni/values/values-artifact-registry.yaml
release:
name: artifact-registry
chart: ./chartCaproni downloads values_file from https://example.com/services/caproni/values/values-artifact-registry.yaml.
When values_file is a list, each relative entry is downloaded the same way.
Your config would reference it like:
version: 2
extends:
- https://example.com/services/caproni.frag.yamlcaproni.local.yaml may also use extends: to pull in local-only fragments that aren’t
committed to version control.
Use caproni config print to see the fully resolved configuration after all composition:
caproni config printEvery deployer in your resolved configuration comes from your caproni.yaml, a
fragment it extends, caproni.local.yaml, or a caproni-project.yaml in an
edit-mode repository. Caproni contributes none. Run caproni config print to see
exactly what will be deployed.
Two kustomize overlays are exceptions in the other direction: they ship inside the
binary and have no YAML you can read, but you still have to declare a deployer to
use them. path: builtin:dev-ca installs the CA Secret, the caproni-ca
ClusterIssuer, the trust Bundle, and a wildcard certificate for
cluster.network.hostname. path: builtin:traefik-tlsstore makes that certificate
Traefik’s default. See
examples/own-infrastructure.yaml.
Up to and including 3.4, Caproni composed two infrastructure fragments beneath every configuration — cert-manager, trust-manager, CloudNativePG, the dev-CA manifests, and on some clusters a Traefik chart — and ordered every one of your deployers after them, whether or not you asked. Caproni 4.0 does neither.
To keep the 3.x stack, extend the fragments published at the v3.4.0 tag. Which
shape you need depends on whether your cluster already runs an ingress controller.
On a cluster with no ingress controller of its own, extend both fragments:
extends:
- https://gitlab.com/gitlab-org/caproni/-/raw/v3.4.0/fragments/caproni.infra.yaml
- https://gitlab.com/gitlab-org/caproni/-/raw/v3.4.0/fragments/caproni.ingress-traefik.yamlOn a k3s-based driver (colima, k3d) the cluster already runs Traefik in
kube-system, and a second Traefik chart fights the first over the same namespace
and ports. Extend the infrastructure fragment alone, and override the TLSStore’s
needs:
extends:
- https://gitlab.com/gitlab-org/caproni/-/raw/v3.4.0/fragments/caproni.infra.yaml
deployers:
caproni-traefik-tlsstore:
needs: [caproni-dev-ca]The override is required, not optional. The fragment declares
caproni-traefik-tlsstore with needs: [caproni-dev-ca, traefik], and the
traefik deployer it names is declared only in the ingress fragment you left out.
Caproni 3.4 erased that edge while composing; 4.0 composes nothing, so the edge
survives and caproni config validate reports:
deployer "caproni-traefik-tlsstore": dependent deployer "traefik" not defined in deployers section: referenced item not foundRedeclaring needs replaces the fragment’s list, which is what makes the TLSStore
wait for the dev CA alone. It still works on such a cluster: it points whichever
Traefik is running at the dev CA’s wildcard certificate, and k3s’s Traefik supplies
the traefik.io CRDs before any deployer runs.
Chart versions still come from the running binary, so pinning the tag freezes the deployer wiring, not the versions. Copy the files into your own repository when you want to change them.
The v3.4.0 tag is a migration aid, not a home: it is frozen at the shape caproni
used to compose, and nothing maintains it. Once you are on 4.0, own the declarations
outright — either by copying them, or by extending a rig that maintains its own.
gitlab-org/gitlab-caproni is one
such rig, and two of its fragments are written to be extended by anyone:
fragments/caproni.infra.yaml
— cert-manager, trust-manager, CloudNativePG and the caproni-dev-ca overlay.fragments/caproni.traefik-tlsstore.yaml
— the caproni-traefik-tlsstore overlay, split out because it is the one piece
that only applies to a Traefik-served cluster.Caproni’s own integration rigs extend both; see
integration-tests/basic/caproni.yaml.
Pin a commit rather than main, so your configuration does not move when that
repository does.
Its remaining fragments are shaped for the GitLab chart rather than for general use.
caproni.ingress-traefik.yaml, despite the name, installs no chart — it sets
global.ingress.* overrides on a gitlab deployer, and extending it in an
unrelated configuration declares that deployer as a side effect.
Whichever way you supply the infrastructure, declare the edges caproni used to add
for you. A deployer that needs cert-manager’s CRDs, the caproni-ca issuer, or the
CloudNativePG operator must say so:
deployers:
my-app:
needs: [caproni-dev-ca]Caproni 3.4 logged a warning naming every deployer that relied on the implicit ordering, so a 3.4 run against your configuration lists exactly what to add.