workload.yaml¶
The workload.yaml in the repository describes how your component runs:
endpoints, environment variables, files and dependencies. The build reads it in the
generate-workload step and, together with the built image, generates the
component's workload from it.
The format is OpenChoreo's Workload Descriptor: not a Kubernetes resource; the fields are top level. You do not enter the image — the build sets it.
Location¶
- Default:
workload.yamlin the root of the repository (more precisely: in the component'srepository.appPath). - Changes to
workload.yamlonly take effect with the next build.
Complete example¶
# Workload descriptor for OpenChoreo. Not a Workload CR: fields are top level.
apiVersion: openchoreo.dev/v1alpha1
metadata:
name: web
endpoints:
- name: http
type: HTTP
port: 3000
basePath: / # optional, see Endpoints and hostnames
visibility:
- project
- internal
- external
configurations:
env:
- name: LOG_LEVEL
value: info
# Secrets never as value — only as a reference (see Configuration and secrets)
- name: API_KEY
valueFrom:
secretKeyRef:
name: myproject-api-key
key: value
files:
- name: settings.json
mountPath: /etc/app
value: |
{"featureX": true}
dependencies:
endpoints:
- component: api
name: http
visibility: project
envBindings:
address: API_URL
resources:
- ref: myproject-db
envBindings:
uri: DATABASE_URL
Fields¶
metadata.name¶
Name of the component (as in the portal).
endpoints¶
| Field | Required | Meaning |
|---|---|---|
name |
yes | Name of the endpoint, e.g. http. Referenced in the component's publish. |
type |
yes | HTTP, GraphQL, Websocket, gRPC, TCP, UDP. Only HTTP, GraphQL and Websocket are published through the gateway. |
port |
yes | Port the container listens on. |
visibility |
no | Where the endpoint is reachable, see below. |
basePath |
no | Path below the project hostname if the component has no publish entry. |
schemaFile |
no | Path to an OpenAPI file; the portal then shows the API. |
visibility on Parkdeck:
| Value | development / staging | production |
|---|---|---|
project |
in-cluster only, for other components of the project | same |
internal |
https://<project>.<environment>.test.ccc-onconnect.de/<path> with login |
— no route |
external |
like internal (also with login) |
https://<project>.app.ccc-onconnect.de/<path>, public |
For a typical web application, set all three. Without external the endpoint is not
reachable from outside in production.
configurations.env¶
Environment variables of the container, each with name and either value
or valueFrom.secretKeyRef (name, key). You override values per environment
when promoting, see Deploy and promote.
configurations.files¶
Files mounted into the container: name (file name), mountPath (directory) and
value (content) or valueFrom.path (file in the repository, relative to
workload.yaml).
dependencies.endpoints¶
If a component calls another component of the same project, declare it here. The
platform then sets the address as an environment variable — in-cluster, without a
detour through the gateway and without login. Possible envBindings: address,
host, port, basePath. See
Endpoint Dependencies.
Internal calls not via the public address
Do not call other components via *.app.ccc-onconnect.de or
*.test.ccc-onconnect.de. The test addresses require a login, and public names
cannot be resolved reliably from inside the cluster.
dependencies.resources¶
Binds a database or another resource of the project. Described in detail under Databases.
Outgoing connections: proxy¶
The cluster reaches the internet only through the corporate proxy. If your application needs external services at runtime (package registries, APIs, Corepack …), set the proxy variables yourself:
configurations:
env:
- name: HTTP_PROXY
value: http://proxy.kite.ume.de:3128
- name: HTTPS_PROXY
value: http://proxy.kite.ume.de:3128
- name: NO_PROXY
value: 172.26.0.0/16,10.99.0.0/24,10.99.1.0/24,.svc,.cluster.local,.cluster.local.,.kite.ume.de,localhost,127.0.0.1
# Node.js (fetch, Corepack) only honours the proxy variables with this:
- name: NODE_USE_ENV_PROXY
value: "1"
For Yarn Berry, add YARN_HTTP_PROXY and YARN_HTTPS_PROXY with the same value if
Yarn downloads packages at runtime.