Skip to main content
Version: Next

Component

A Component represents a deployable unit of an application in OpenChoreo. It serves as the core abstraction that defines the component type (Service, WebApplication, ScheduledTask, etc.) and optionally includes build 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 that must be created within an Organization's namespace and belong to a Project through the owner field.

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

Spec Fields

FieldTypeRequiredDefaultDescription
ownerComponentOwnerYes-Ownership information linking the component to a project
typeComponentTypeYes-Specifies the component type (Service, WebApplication, ScheduledTask, etc.)
buildBuildSpecInComponentNo-Optional build configuration when using OpenChoreo CI to build from source (omit for pre-built images)

ComponentOwner

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

ComponentType

The component type determines how the component will be deployed and what resources it can create.

ValueDescription
ServiceLong-running service component
WebApplicationWeb application with HTTP endpoints
ScheduledTaskScheduled/cron job component

BuildSpecInComponent

FieldTypeRequiredDefaultDescription
repositoryBuildRepositoryYes-Source repository configuration where the component code resides
templateRefTemplateRefYes-Build template reference (ClusterWorkflowTemplate in the build plane)

BuildRepository

FieldTypeRequiredDefaultDescription
urlstringYes-Repository URL (e.g., https://github.com/org/repo)
revisionBuildRevisionYes-Default revision configuration for builds
appPathstringYes-Path to the application within the repository (relative to root, e.g., ".")

BuildRevision

FieldTypeRequiredDefaultDescription
branchstringYes-Default branch to build from when no specific commit provided

TemplateRef

FieldTypeRequiredDefaultDescription
enginestringNo-Build engine to use
namestringYes-Name of the build template
parameters[Parameter]No[]Template parameters

Parameter

FieldTypeRequiredDefaultDescription
namestringYes-Parameter name
valuestringYes-Parameter value

Status Fields

FieldTypeDefaultDescription
observedGenerationinteger0The generation observed by the controller
conditions[]Condition[]Standard Kubernetes conditions tracking component state

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 Docker Build

apiVersion: openchoreo.dev/v1alpha1
kind: Component
metadata:
name: customer-service
namespace: default
spec:
owner:
projectName: my-project
type: Service
build:
repository:
url: https://github.com/myorg/customer-service
revision:
branch: main
appPath: .
templateRef:
name: docker
parameters:
- name: docker-context
value: .
- name: dockerfile-path
value: ./Dockerfile

WebApplication Component with Buildpacks

apiVersion: openchoreo.dev/v1alpha1
kind: Component
metadata:
name: frontend-app
namespace: default
spec:
owner:
projectName: my-project
type: WebApplication
build:
repository:
url: https://github.com/myorg/frontend
revision:
branch: develop
appPath: ./webapp
templateRef:
name: google-cloud-buildpacks

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
  • Build - Build jobs triggered by components
  • Workload - Workload definitions associated with components
  • Service - Service-type component resources
  • WebApplication - WebApplication-type component resources
  • ScheduledTask - ScheduledTask-type component resources