Skip to main content
Version: Next

Build

A Build represents a build job in OpenChoreo that transforms source code into a container image. It defines the source repository, revision, and build template to use for creating workloads. Upon successful completion, a Build creates a Workload resource containing the built container image.

API Version

openchoreo.dev/v1alpha1

Resource Definition

Metadata

Builds are namespace-scoped resources that must be created within an Organization's namespace and belong to a Component through the owner field.

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

Spec Fields

FieldTypeRequiredDefaultDescription
ownerBuildOwnerYes-Ownership information linking the build to a project and component
repositoryRepositoryYes-Source repository configuration
templateRefTemplateRefYes-Build template reference and parameters

BuildOwner

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

Repository

FieldTypeRequiredDefaultDescription
urlstringYes-Repository URL (e.g., https://github.com/org/repo)
revisionRevisionYes-Revision specification for the build
appPathstringYes-Path to the application within the repository (e.g., "." for root)

Revision

FieldTypeRequiredDefaultDescription
branchstringNo""Branch to build from
commitstringNo""Specific commit hash to build from (takes precedence over branch)

TemplateRef

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

Parameter

FieldTypeRequiredDefaultDescription
namestringYes-Parameter name
valuestringYes-Parameter value

Status Fields

FieldTypeDefaultDescription
conditions[]Condition[]Standard Kubernetes conditions tracking the build state
imageStatusImageInformation about the built image

Image

FieldTypeDefaultDescription
imagestring""Full image reference including registry, name, and digest

Condition Types

Common condition types for Build resources:

  • Ready - Indicates if the build has completed successfully
  • Building - Indicates if the build is currently in progress
  • Failed - Indicates if the build has failed

Examples

Build with Docker Template

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

Build with Buildpacks

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

Annotations

Builds support the following annotations:

AnnotationDescription
openchoreo.dev/display-nameHuman-readable name for UI display
openchoreo.dev/descriptionDetailed description of the build
  • Component - Components that trigger builds
  • Workload - Workloads created by successful builds
  • BuildPlane - Infrastructure where builds execute