Skip to main content

Component Type

A ComponentType is the template a developer picks when they create a Component — and by picking it, they accept the workload shape, the configurable parameters, the Kubernetes resources that get generated, and the builders they may use. It's the single most important thing a platform engineer authors: the ComponentType is the golden path.

A ClusterComponentType is the cluster-scoped variant — same spec, visible to every organization namespace. The platform's defaults ship as ClusterComponentTypes.

KindComponentType / ClusterComponentType
API groupopenchoreo.dev/v1alpha1
ScopeNamespaced / Cluster
AudiencePlatform engineer
Referenced byComponent (spec.componentType)
GatesTraits (allowedTraits), Workflows (allowedWorkflows)

Key spec fields

FieldWhat it does
spec.workloadTypeThe primary Kubernetes resource: deployment, statefulset, cronjob, job, or proxy
spec.parameters.openAPIV3SchemaWhat a developer sets once per release — identical in every environment
spec.environmentConfigs.openAPIV3SchemaWhat can be overridden per environment via a ReleaseBinding
spec.resources[]The Kubernetes manifests generated from the above, via CEL templating (forEach, includeWhen, var)
spec.allowedTraits[]Which Traits developers may attach
spec.allowedWorkflows[]Which build Workflows developers may use

The parameters vs environmentConfigs split is what makes "build once, promote everywhere" work: parameters are captured in the immutable release; environment configs differ per environment while the release snapshot stays byte-for-byte identical.

Create in the portal

ComponentTypes are authored as YAML in the in-portal editor:

  1. Open Create…Platform ResourcesClusterComponentType (cluster-wide) or ComponentType (namespace-scoped).
  2. The in-portal YAML editor opens seeded with the kind. Fill in workloadType, the parameter and environment schemas, the resource templates, and allowedTraits / allowedWorkflows.
  3. Click Create. The new type then appears as an option in the Create Component wizard.

Authoring is schema + CEL work — there's no no-YAML wizard. Full guide: Component types.

Example

A trimmed web-service ClusterComponentType — a Deployment plus an HTTPRoute per external endpoint:

apiVersion: openchoreo.dev/v1alpha1
kind: ClusterComponentType
metadata:
name: web-service # cluster-scoped: no metadata.namespace
spec:
workloadType: deployment
allowedTraits:
- kind: ClusterTrait
name: autoscaler
allowedWorkflows:
- kind: ClusterWorkflow
name: dockerfile-builder
parameters:
openAPIV3Schema:
type: object
properties:
replicas: { type: integer, default: 1, minimum: 1 }
environmentConfigs:
openAPIV3Schema:
type: object
properties:
resources:
type: object
properties:
cpu: { type: string, default: "100m" }
memory: { type: string, default: "256Mi" }
resources:
- id: deployment
template:
apiVersion: apps/v1
kind: Deployment
metadata:
name: ${metadata.componentName}
namespace: ${metadata.namespace}
spec:
replicas: ${parameters.replicas}
# … containers, resources from ${environmentConfigs.resources.*} …
warning

A ClusterComponentType is cluster-scoped, so its manifest must not set metadata.namespace.

See also