Skip to main content
Version: v0.5.x

ComponentRelease

A ComponentRelease represents an immutable snapshot of a component's configuration at a specific point in time in OpenChoreo. It captures the complete component specification including the ComponentType, Traits, parameters, and Workload template with the built image. ComponentReleases ensure reproducibility and enable rollback by preserving the exact state of a component when it was released.

API Version​

openchoreo.dev/v1alpha1

Resource Definition​

Metadata​

ComponentReleases are namespace-scoped resources that must be created within an Organization's namespace.

apiVersion: openchoreo.dev/v1alpha1
kind: ComponentRelease
metadata:
name: <componentrelease-name>
namespace: <org-namespace> # Organization namespace

Spec Fields​

FieldTypeRequiredDefaultDescription
ownerComponentReleaseOwnerYes-Ownership information linking the release to a project and component
componentTypeComponentTypeSpecYes-Immutable snapshot of the ComponentType at release time
traitsmap[string]TraitSpecNoImmutable snapshot of trait specifications at release time
componentProfileComponentProfileYes-Immutable snapshot of parameter values and trait configurations
workloadWorkloadTemplateSpecYes-Immutable snapshot of the workload specification with the built image

ComponentReleaseOwner​

FieldTypeRequiredDefaultDescription
projectNamestringYes-Name of the project that owns this component release
componentNamestringYes-Name of the component this release belongs to

ComponentProfile​

ComponentProfile contains the frozen parameter values and trait configurations at the time of release.

FieldTypeRequiredDefaultDescription
parametersruntime.RawExtensionNo-Merged schema of parameters + envOverrides from the ComponentType
traits[ComponentTrait]No[]Trait instances with their configurations

ComponentTrait​

FieldTypeRequiredDefaultDescription
namestringYes-Name of the Trait resource
instanceNamestringYes-Unique identifier for this trait instance within the component
parametersruntime.RawExtensionNo-Trait parameter values conforming to the trait's schema

WorkloadTemplateSpec​

The WorkloadTemplateSpec contains the complete workload specification with the built container image.

FieldTypeRequiredDefaultDescription
containersmap[string]ContainerYes-Container specifications keyed by container name. Must have at least one container with key "main"
endpointsmap[string]WorkloadEndpointNoNetwork endpoints for port exposure keyed by endpoint name
connectionsmap[string]WorkloadConnectionNoConnections to internal/external resources keyed by connection name. Supports template variables

Status Fields​

Currently, ComponentRelease does not have any status fields defined.

Examples​

Basic ComponentRelease for a Service Component​

apiVersion: openchoreo.dev/v1alpha1
kind: ComponentRelease
metadata:
name: customer-service-v1.0.0
namespace: default
spec:
owner:
projectName: my-project
componentName: customer-service
componentType:
workloadType: deployment
schema:
parameters:
runtime:
port: "integer | default=8080"
resources:
- id: deployment
template:
apiVersion: apps/v1
kind: Deployment
metadata:
name: "${metadata.name}"
spec:
replicas: 1
template:
spec:
containers:
- name: main
image: "${spec.workload.containers.main.image}"
ports:
- containerPort: "${spec.parameters.runtime.port}"
componentProfile:
parameters:
runtime:
port: 8080
workload:
containers:
main:
image: myregistry/customer-service@sha256:abc123...
env:
- key: LOG_LEVEL
value: info
endpoints:
api:
type: REST
port: 8080

ComponentRelease with Traits​

apiVersion: openchoreo.dev/v1alpha1
kind: ComponentRelease
metadata:
name: order-service-v2.1.0
namespace: default
spec:
owner:
projectName: my-project
componentName: order-service
componentType:
workloadType: deployment
schema:
parameters:
runtime:
replicas: "integer | default=1"
resources:
- id: deployment
template:
apiVersion: apps/v1
kind: Deployment
metadata:
name: "${metadata.name}"
spec:
replicas: "${spec.parameters.runtime.replicas}"
traits:
persistent-volume:
schema:
parameters:
volumeName: "string | required=true"
mountPath: "string | required=true"
envOverrides:
size: "string | default=10Gi"
patches:
- target:
id: deployment
operations:
- op: add
path: /spec/template/spec/volumes/-
value:
name: "${spec.traits.volumeName}"
componentProfile:
parameters:
runtime:
replicas: 3
traits:
- name: persistent-volume
instanceName: data-volume
parameters:
volumeName: data
mountPath: /var/data
size: 20Gi
workload:
containers:
main:
image: myregistry/order-service@sha256:def456...
env:
- key: DATA_DIR
value: /var/data
endpoints:
order-api:
type: REST
port: 8080
connections:
database:
type: api
params:
projectName: my-project
componentName: postgres-db
endpoint: tcp-endpoint
inject:
env:
- name: DATABASE_HOST
value: "{{ .host }}"
- name: DATABASE_PORT
value: "{{ .port }}"

Immutability​

ComponentRelease is designed to be immutable once created. All spec fields have validation rules that prevent modifications after creation:

  • spec.componentType - Immutable
  • spec.traits - Immutable
  • spec.componentProfile - Immutable
  • spec.workload - Immutable

This ensures that a ComponentRelease always represents the exact state of the component at a specific point in time, enabling reliable rollbacks and auditing.

Annotations​

ComponentReleases support the following annotations:

AnnotationDescription
openchoreo.dev/display-nameHuman-readable name for UI display
openchoreo.dev/descriptionDetailed description of the component release
openchoreo.dev/versionSemantic version or tag for this release
  • Component - Components that ComponentReleases are created from
  • ComponentType - Component type definitions captured in releases
  • Trait - Trait specifications captured in releases
  • Workload - Workload specifications captured in releases
  • ReleaseBinding - Binds a ComponentRelease to a target environment for deployment