Skip to main content
Version: Next

Workload Descriptor

When a CI workflow builds your code, it produces a Workload CR that OpenChoreo deploys. By default, the build creates a minimal Workload with just the container image. To define endpoints, environment variables, and configuration files, add a workload.yaml descriptor to your source repository.

With vs Without a Descriptor​

Without workload.yamlWith workload.yaml
Container imageSet from build outputSet from build output
EndpointsNoneDefined in descriptor
Environment variablesNoneDefined in descriptor
Configuration filesNoneDefined in descriptor
Use caseSimple services with no exposed endpointsServices with HTTP/gRPC/WebSocket endpoints, custom configuration

Descriptor Format​

Place a workload.yaml file in your application directory (the path specified by repository.appPath in your Component's workflow parameters):

# workload.yaml
apiVersion: openchoreo.dev/v1alpha1

metadata:
name: reading-list-service

endpoints:
- name: reading-list-api
visibility:
- external
port: 8080
type: HTTP
schemaFile: docs/openapi.yaml

configurations:
env:
- name: LOG_LEVEL
value: info
- name: APP_ENV
value: production
files:
- name: app-config
mountPath: /etc/config/app.json
value: |
{"feature_flags": {"new_feature": true}}

Fields​

metadata​

FieldRequiredDescription
nameYesName for the generated Workload CR

endpoints​

Define the network endpoints your service exposes:

FieldRequiredDescription
nameYesUnique name for the endpoint
portYesPort your application listens on
typeYesHTTP, gRPC, GraphQL, Websocket, TCP, or UDP
visibilityNoList of visibility levels: project, namespace, internal, external
schemaFileNoPath to schema file (OpenAPI, Protobuf, GraphQL), relative to the workload.yaml location

configurations​

configurations.env​

Environment variables injected into the container:

FieldRequiredDescription
nameYesEnvironment variable name
valueYesEnvironment variable value
configurations.files​

Configuration files mounted into the container:

FieldRequiredDescription
nameYesUnique name for the file mount
mountPathYesAbsolute path where the file is mounted
valueYesFile content (inline)

File Placement​

The CI workflow looks for workload.yaml at the root of your appPath. For example, if your Component specifies appPath: "/service-go-greeter", place the descriptor at:

your-repo/
service-go-greeter/
workload.yaml ← descriptor file
Dockerfile
main.go
openapi.yaml ← referenced by schemaFile

See Also​