Cluster Profiles
Status: published prerelease | Issue: go-kure/launcher#37
| Version | Date | Summary |
|---|---|---|
| 1.1 | 2026-05-14 | Remove parameters field; update GVK to launcher.gokure.dev/v1alpha1; add strictness rule; add migration guide |
| 1.0 | 2026-04-19 | Initial draft |
1. Purpose
A ClusterProfile tells the launcher runtime how the platform implements each trait.
It is an environment-level document, written once per cluster by the platform operator and
shared across all applications deployed to that cluster.
The separation it enforces: an Application says “I need ingress” — the ClusterProfile
says “ingress on this cluster means a Gateway API HTTPRoute.” The application spec is
portable; the profile is not.
2. Schema
Field reference
| Field | Type | Description |
|---|---|---|
metadata.name | string | Identifies the cluster; referenced in build tooling |
spec.gitopsEngine | string | GitOps engine whose delivery CRs the built-in components emit. Accepted: "fluxcd" (default, optional). |
spec.kubernetesVersion | string | The Kubernetes release the cluster runs, optional: 1.35, v1.35 or v1.35.2, the forms helm template --kube-version takes; a patch level is read and ignored, and only major 1 is accepted. When set, kurel build refuses an authored property whose Kubernetes feature gate is off by default at that release (see “Target Kubernetes version” below). Absent means unknown: nothing is checked and the build is what it was before the field existed. A release newer than the k8s.io/api version launcher is built against is a valid target and reads as every known gate on. |
spec.featureGates | map of string to bool | Optional. Overrides, per gate, the state spec.kubernetesVersion implies, for a cluster that sets a gate other than the release default. A gate set true is on and a gate set false is off, at any version. A name outside the gate table (see “Target Kubernetes version” below) is refused with the known names, and the field needs spec.kubernetesVersion: a profile that sets one without the other is refused with spec.featureGates needs spec.kubernetesVersion. |
spec.capabilities | map | Keys are trait types; values are capability bindings |
capabilities.<type>.rendering | map | Platform values merged into trait properties before handler invocation, and into the listed properties of a component whose handler implements ComponentCapabilityDefaults (the persistentvolumeclaim kind reads pvc’s storageClassName). A value ComponentCapabilityDefaults fills into a component is validated against that component’s own property schema; a component handler with no schema is refused unless the trait handler or rule registered for the capability’s type validates the rendering, by implementing ValidateAndApplyDefaults or, for a type that is not built in, through a loaded CapabilityDefinition (go-kure/launcher#751, go-kure/launcher#772). A lowering rule may read a binding through LoweringContext.Capability: webservice and worker fill pvc’s storageClassName into the claims their pvc volumes describe (go-kure/launcher#746). A component handler may read one through ComponentCapabilityFiller: statefulset fills it into its volumeClaimTemplates entries (go-kure/launcher#761) |
Target Kubernetes version
spec.kubernetesVersion tells a build which Kubernetes release the cluster runs, so a
field the cluster cannot accept is refused at build time instead of at apply time
(go-kure/launcher#1183). It is the same idea as helm template --kube-version, and the
same string works in both.
Absent means unknown. Nothing is checked, the published schemas read as before, and every existing document and profile builds exactly as it did. The check never changes what an accepted document renders to: a document either builds as it always did or is refused.
A gated property is refused, never adapted. Some properties are behind a Kubernetes feature gate that is off by default on older releases. The schema names the gate (
PropertySchema.Gate, published asgate). When the profile’s version is below the release where the gate is on by default, an authored value is refused with the property’s path, the gate, that release and the profile’s version. Falling back to another shape (an image volume as an init container, say) needs a design per field and is not done.The table.
pkg/oam/featuregates.goholds one row per gate: its name and the first release where its Default is true, read from the Kubernetes feature gates reference. Two tests keep it honest: everyGatea built-in schema carries names a row, and every row is carried by at least one schema or listed inoam.CodeCheckedGates(a gate that code checks on generated objects, with no property to name it).Gate On by default from Properties EnvFiles1.35 env[].valueFrom.fileKeyRefContainerRestartRules1.35 restartPolicyRules(an init container’s on the workload kinds; any container’s on the raw-PodSpec kinds below), and on the workload kinds the valuesNeverandOnFailureof an init container’srestartPolicy(Alwaysis accepted at every version; on the raw-PodSpec kinds the same values are checked throughvalueGatedPaths, and a regular container’srestartPolicyis gated whole, go-kure/launcher#1330)PodLevelResources1.34 podResources(the pod kinds’resources)HostnameOverride1.35 hostnameOverridePreferSameTrafficDistribution1.34 the values PreferSameZoneandPreferSameNodeofservice’strafficDistribution(PreferCloseis accepted at every version)RelaxedServiceNameValidation1.36 no property: the name of a generated Service that starts with a digit, checked on the objects (below) A gate that covers single values of an enum is named per value (
PropertySchema.ValueGates, published asvalueGates); the refusal then names the value as well (go-kure/launcher#1230).A cluster that differs from its release says so in
spec.featureGates(go-kure/launcher#1231). An entry replaces the table’s answer for that gate, in both directions:HostnameOverride: trueaccepts the field at 1.34, andHostnameOverride: falserefuses it at 1.36. A refusal an entry caused namesspec.featureGatesand the value it set, not the version. The override reaches the authored-property check and the Service-name check on the generated objects alike. It only refuses or accepts, so an accepted document renders the same with or without it. The profile must statespec.kubernetesVersiontoo: with no version nothing is checked, and a gate map next to no version would be a half-check, so the parse refuses it. There is no lock or removal state: an entry is honoured on either side of a gate’s upstream lifecycle, including a release where Kubernetes has locked or removed the gate, and launcher does not tell the author that the entry no longer changes the cluster.Open schemas name their gated paths. The check walks the declared schema, so it stops at an object that declares no
Properties. The raw-PodSpec kinds (pod, and the kinds that take a pod template:podtemplate,replicaset,replicationcontroller) leave their containers and template spec open, as does thetemplateofcnpg-pooler(go-kure/launcher#1321), so the open node carriesPropertySchema.GatedPaths(published asgatedPaths): gate-relative paths to the gate that field needs, such asenv[].valueFrom.fileKeyReftoEnvFiles. The check reads it and refuses the same way as for a declaredGate, naming the authored path (template.spec.containers[0].env[0].valueFrom.fileKeyRef). The raw-kind decode matches field names case-insensitively, so the check does too: every key of an open object that matches a path key in any case is walked, and the refusal names the spelling the author wrote (template.spec.HostnameOverride). Property validation does not read it, so what a document is accepted as is unchanged. The paths areenv[].valueFrom.fileKeyRefandrestartPolicyRulesofcontainers[]andinitContainers[], therestartPolicyofcontainers[], andhostnameOverrideandresourcesof the pod spec (template.spec.*on a pod template and on thecnpg-poolertemplate). A path that gates single values sits inPropertySchema.ValueGatedPaths(published asvalueGatedPaths), a map from a path to a map from a value to its gate: therestartPolicyofinitContainers[]is there withNeverandOnFailure, from the same table as the shorthand (go-kure/launcher#1330). Declaring them as nestedPropertiesinstead would make the validator type-check and null-strip them, which changes what is accepted (go-kure/launcher#1245). A test holds every gate agatedPathsvalue names to a row of the table and every path to a field of the Kubernetes type.Newer than launcher knows. A release above the
k8s.io/apiversion launcher is built against is a valid target: a newer cluster is not wrong. The table then reads every gate it knows as on, and says nothing about a gate it does not know.A cluster that changed a gate against its default says so in
spec.featureGates, which overrides the table per gate (go-kure/launcher#1231, above). Adapting instead of refusing is a follow-up (go-kure/launcher#1232).A Service name is checked on the objects, not on a property. Below 1.36 the API server holds a Service name to a DNS-1035 label (
RelaxedServiceNameValidationis off), which refuses a leading digit. The check reads the generated objects, so a default name, aNaminghook’s answer and a role override are held the same as an authored name: a corev1Service (metadata.name), a CloudNativePGPooler(metadata.name), a CloudNativePGCluster(spec.managed.services.additional[].serviceTemplate.metadata.name) and the Prometheus operator’sPrometheus,PrometheusAgent,AlertmanagerandThanosRuler(spec.serviceName, the only kinds of its API that have the field), whose operators create or look up the Service. The check reads the object as the writer writes it (its JSON, kind and apiVersion included), so a list or number built in Go is read as a decoded one is; an object of these kinds that does not encode as JSON is refused below 1.36 as a violation of its owning component, since the name it holds cannot be read. The refusal is a violation of the owning component, and names the object, the field, the gate, release 1.36 and the profile’s version. Astatefulset’sserviceNameis not checked: the API server validates it as a DNS-1123 label at every release, and the Service it names is aservicecomponent’s, which is. An Ingress backend naming such a Service is not checked separately.Where it runs.
kurel buildreads the profile’s version and itsspec.featureGatesand passes both toValidateAuthoredPropertiesForTargetWithGates. A library caller does the same itself;ValidateAuthoredPropertiesForTargetis that call with no gates, so it ignores a profile’s overrides, andValidateAuthoredPropertiesWithCapabilitiestakes no version and checks no gate. The Service name check runs later, when the objects are generated (oam.GenerateApplications), fromTransformContext.TargetVersionandTransformContext.FeatureGates: a caller that leavesTargetVersionunset gets no check, and a caller that transforms and never generates sees no refusal.kurel buildsets both from the same profile.
Capability schema
cluster.yaml does not carry capability schema — it only carries rendering values.
The schema of what keys a given capability accepts (types, required fields, descriptions)
is separate from the profile itself.
For built-in handlers, the rendering schema lives in typed Go structs in
pkg/oam/builtin/, one struct per capability type. The handler validates and applies
defaults via a ValidateAndApplyDefaults method at ClusterProfile evaluation time.
Unknown rendering keys for built-in handlers are a build error — consistent with the
strict-by-default principle in design-gvk.md.
For custom capabilities (handlers registered by downstream consumers via library
embedding), the rendering schema is optionally declared in a CapabilityDefinition
document (Phase 2/3). See design-capability-schema.md for the full design.
Strictness
Launcher rejects unknown fields in cluster.yaml. A ClusterProfile with unrecognised
keys is a build error. See design-gvk.md for the parser strictness rationale.
What is NOT in a launcher ClusterProfile
A downstream platform runtime may layer additional fields onto its own cluster profile.
Those fields are downstream-specific and must not appear in a launcher cluster.yaml:
- delivery-layer wiring (FluxCD/ArgoCD engine configuration blocks)
- component-catalog / artifact-registry references
- downstream component-variant selection
Note: spec.gitopsEngine (a single string field) is launcher-specific and IS present in
launcher ClusterProfiles. It names the GitOps engine whose delivery CRs are emitted by
the built-in components. It is not the same as a downstream runtime’s full delivery-wiring
block, which stays in that runtime only.
3. Capability Key Resolution
At build time the runtime looks up a capability for each trait using a two-step key resolution:
- Scoped key —
<type>.<scope>wherescopecomes from the trait’sproperties.scopefield, if set. Allows a cluster to configure multiple implementations of the same trait type (e.g. public and internal ingress). - Bare key —
<type>— used whenscopeis absent or no scoped entry is found.
trait.type = "expose"
trait.properties.scope = "internal"
→ look up "expose.internal" in capabilities
→ if not found, look up "expose" in capabilities
→ if not found, no capability is resolved (handler proceeds without platform values)Both key forms may be present in the same profile:
4. Merge Semantics
Rendering values are platform-provided defaults. Application inline properties always take precedence:
resolved = rendering ∪ application-properties (application overwrites)An application property authored as null is absent, so it does not overwrite: the
rendering’s value stands (go-kure/launcher#742).
A rendering value reaches the handler as a copy with its decoded type kept, so a 3
stays an integer. The transform refuses a rendering holding a null below the top
level, NaN or ±Inf, or a Go value that is not a string, boolean, number, list or
string-keyed object, before it builds anything (go-kure/launcher#756).
Example:
If the Application overrides an individual key within a nested map, only that key is
overridden; sibling keys from rendering are preserved (go-kure/launcher#750). The
merge recurses wherever both sides hold a map; a list, or a value of another kind,
replaces the rendered value whole. A null is absent at any depth. Authored
validation checks nested Required on the merged properties, so a partial override
that relies on the rendering for a required sibling is accepted
(go-kure/launcher#765).
5. Example Cluster Profiles
nginx ingress + cert-manager (Let’s Encrypt) + Vault ESO
Gateway API + cert-manager (internal CA) + AWS Secrets Manager
Minimal (ingress only)
6. CapabilityAware handlers
Some trait handlers require a capability to produce correct output — for example, the
expose handler must know controllerType to dispatch to the right implementation.
These handlers implement the CapabilityAware interface (defined in pkg/oam):
If CapabilityRequired() returns true and no capability resolves for the trait, the
runtime returns ErrMissingCapability and the build fails with a message naming the
trait type and the cluster profile in use.
Handlers that do not implement CapabilityAware, or whose CapabilityRequired() returns
false, proceed without a capability and rely solely on Application inline properties.
7. Migrating from a downstream cluster profile
A downstream platform runtime may define its own richer ClusterProfile that a launcher
cluster.yaml is derived from. Launcher consumes only the capability model above:
spec.capabilities and its per-capability rendering values map across unchanged.
Everything else — delivery-layer wiring, catalog/registry references, component-variant
selection, and any per-capability parameters schema — is out of scope for a launcher
cluster.yaml and stays in the downstream runtime. spec.gitopsEngine is a launcher-only
addition with no upstream equivalent.
The concrete field-by-field mapping and migration steps for a specific downstream runtime live in that runtime’s own documentation, not here.