Skip to main content

Component

A Component is a deployable unit of software — a service, a web app, a worker, a scheduled job. It belongs to a Project and, by picking a ComponentType, accepts a workload shape and a set of configurable parameters. A component can attach Traits for extra capabilities and reference a Workflow to build itself from source.

Each change to a component (or its Workload) is snapshotted into an immutable ComponentRelease — the unit you deploy and promote.

KindComponent (short: comp)
API groupopenchoreo.dev/v1alpha1
ScopeNamespaced
AudienceDeveloper
ParentProject (spec.owner.projectName)
SelectsComponentType, Traits, a Workflow
ProducesWorkload, ComponentRelease

Where it sits​

Project
└── Component ← you are here
├── Workload → Endpoint
└── ComponentRelease → ReleaseBinding → RenderedRelease

Key spec fields​

FieldDescription
spec.owner.projectNameThe project this component belongs to (immutable)
spec.componentType.kindComponentType or ClusterComponentType
spec.componentType.nameworkloadType/name, e.g. deployment/web-service
spec.parametersValues for the ComponentType's parameter schema, captured in every release
spec.traits[]Attached traits — name, kind, instanceName, parameters
spec.workflowThe build Workflow (must be in the ComponentType's allowedWorkflows)
spec.autoDeployWhen true, each new release is bound to the first environment automatically

Create in the portal​

Components are created with the Create Component wizard:

  1. Open Create… → Application Resources → Component.
  2. General — name the component (e.g. shortener-api) and select its Project (url-shortener) and a ComponentType (e.g. deployment/web-service).
  3. Build & Deploy — choose Build from Source (point at the repo) or Container Image (a prebuilt image), and set args / env vars.
  4. Service Details — add the endpoints the component exposes and their visibility.
  5. Click Create. With autoDeploy on, the first release binds to the first environment automatically.

Prefer YAML/GitOps? See the Example below, or Projects and components.

Example​

apiVersion: openchoreo.dev/v1alpha1
kind: Component
metadata:
name: cart-api
namespace: fedshi
spec:
owner:
projectName: checkout
componentType:
kind: ClusterComponentType
name: deployment/web-service
parameters:
replicas: 2
traits:
- name: autoscaler
kind: ClusterTrait
instanceName: hpa
parameters:
maxReplicas: 5
autoDeploy: true

The component can only attach Traits the ComponentType lists in allowedTraits, and only build with Workflows in allowedWorkflows — a disallowed reference stops the component in a WorkflowNotAllowed state.

See also​