Skip to main content
Version: v1.0.0-rc.2 (pre-release)

Component

A Component represents a deployable unit of an application in OpenChoreo. It serves as the core abstraction that references a platform-defined ComponentType (or ClusterComponentType) and optionally includes workflow configuration when using OpenChoreo's CI system to build from source. Components are the primary building blocks used to define applications within a Project.

API Version​

openchoreo.dev/v1alpha1

Resource Definition​

Metadata​

Components are namespace-scoped resources and belong to a Project through the owner field.

apiVersion: openchoreo.dev/v1alpha1
kind: Component
metadata:
name: <component-name>
namespace: <namespace> # Namespace for grouping components

Spec Fields​

FieldTypeRequiredDefaultDescription
ownerComponentOwnerYes-Ownership information linking the component to a project
componentTypeComponentTypeRefYes-Reference to a ComponentType or ClusterComponentType
autoDeploybooleanNofalseAutomatically deploy the component when created
autoBuildbooleanNo-Automatically trigger builds when code is pushed; requires webhook configuration in the Git provider
parametersobjectNo-Parameter values merged from the ComponentType's parameter and environmentConfigs schema
traits[ComponentTrait]No[]Traits to compose into this component; each trait can be instantiated multiple times
workflowComponentWorkflowConfigNo-Workflow configuration for building the component; references a Workflow or ClusterWorkflow CR

ComponentOwner​

FieldTypeRequiredDefaultDescription
projectNamestringYes-Name of the project that owns this component (min: 1)

ComponentTypeRef​

FieldTypeRequiredDefaultDescription
kindstringNoComponentTypeKind of the referenced resource: ComponentType (namespace-scoped) or ClusterComponentType (cluster-scoped)
namestringYes-Name in {workloadType}/{componentTypeName} format (e.g., deployment/service)

The componentType field references a platform-defined ComponentType or ClusterComponentType using a structured object with kind and name fields. The kind defaults to ComponentType (namespace-scoped) but can be set to ClusterComponentType for cluster-scoped types.

ComponentWorkflowConfig​

Defines the workflow used to build the component. The referenced Workflow must be listed in the allowedWorkflows of the ComponentType.

FieldTypeRequiredDefaultDescription
kindstringNoClusterWorkflowKind of the workflow resource: Workflow (namespace-scoped) or ClusterWorkflow (cluster-scoped)
namestringYes-Name of the Workflow or ClusterWorkflow CR to use
parametersobjectNo-Developer-provided parameter values validated against the Workflow's schema

ComponentTrait​

FieldTypeRequiredDefaultDescription
kindstringNoTraitKind of the trait resource: Trait (namespace-scoped) or ClusterTrait (cluster-scoped)
namestringYes-Name of the Trait resource to use (min: 1)
instanceNamestringYes-Unique identifier for this trait instance within the component (min: 1)
parametersobjectNo-Trait parameter values; schema is defined by the Trait resource

Status Fields​

FieldTypeDefaultDescription
observedGenerationinteger0The generation observed by the controller
conditions[]Condition[]Standard Kubernetes conditions tracking component state
latestReleaseLatestRelease-Information about the latest ComponentRelease created for this component

LatestRelease​

FieldTypeDescription
namestringName of the latest ComponentRelease resource
releaseHashstringHash of the ComponentRelease spec

Condition Types​

Common condition types for Component resources:

  • Ready - Indicates if the component is ready
  • Reconciled - Indicates if the controller has successfully reconciled the component

Examples​

Service Component with Workflow Build​

apiVersion: openchoreo.dev/v1alpha1
kind: Component
metadata:
name: customer-service
namespace: default
spec:
owner:
projectName: my-project
componentType:
kind: ComponentType
name: deployment/service
workflow:
name: docker
parameters:
dockerContext: .
dockerfilePath: ./Dockerfile

WebApplication Component with Auto Deploy​

apiVersion: openchoreo.dev/v1alpha1
kind: Component
metadata:
name: frontend-app
namespace: default
spec:
owner:
projectName: my-project
componentType:
kind: ComponentType
name: deployment/web-app
autoDeploy: true
autoBuild: true
workflow:
kind: ClusterWorkflow
name: google-cloud-buildpacks

Component with Traits​

apiVersion: openchoreo.dev/v1alpha1
kind: Component
metadata:
name: backend-service
namespace: default
spec:
owner:
projectName: my-project
componentType:
kind: ClusterComponentType
name: deployment/service
traits:
- kind: ClusterTrait
name: oauth2-proxy
instanceName: auth
parameters:
provider: github

Annotations​

Components support the following annotations:

AnnotationDescription
openchoreo.dev/display-nameHuman-readable name for UI display
openchoreo.dev/descriptionDetailed description of the component
  • Project - Contains components
  • Workload - Workload definitions associated with components
  • ComponentType - Platform-defined templates referenced by components
  • ComponentRelease - Immutable release snapshots for deployment