Skip to main content

Resource

A Resource is a declared dependency on managed infrastructure — a database, a cache, a queue, an object store. It's a thin reference to a ResourceType (which governs how the infrastructure is provisioned) plus the parameters a developer is allowed to set. A Workload consumes a Resource by binding its declared outputs (host, port, password) into the container as environment variables or files.

Like a component, a Resource is snapshotted into an immutable ResourceRelease, which a ResourceReleaseBinding renders into each environment.

KindResource (short: res)
API groupopenchoreo.dev/v1alpha1
ScopeNamespaced
AudienceDeveloper
ParentProject (spec.owner.projectName)
SelectsResourceType (spec.type)
Consumed byWorkloads via dependencies.resources[]

Where it sits

Project
└── Resource ← you are here
└── ResourceRelease → ResourceReleaseBinding → RenderedRelease

Key spec fields

FieldDescription
spec.owner.projectNameThe project this resource belongs to
spec.type.kindResourceType or ClusterResourceType
spec.type.nameThe resource-type template name, e.g. valkey-cache
spec.parametersValues for the ResourceType's parameter schema (engine version, size class, …)

Create in the portal

  1. Open Create…Application ResourcesResource.
  2. Name it (e.g. the url-shortener cache), select the Project (url-shortener), and pick the ResourceType (e.g. a Redis/Valkey cache type).
  3. Set the parameters the type exposes (engine version, size class).
  4. Click Create. Then bind its outputs into a component under the workload's dependencies (see the consuming Workload).

Prefer YAML/GitOps? See the Example below, or Dependencies.

Example

apiVersion: openchoreo.dev/v1alpha1
kind: Resource
metadata:
name: cart-cache
namespace: fedshi
spec:
owner:
projectName: checkout
type:
kind: ResourceType
name: valkey-cache
parameters:
version: "8"

A workload then binds the outputs by name — the developer never sees the StatefulSet, the Secret, or the connection string:

# in the consuming Workload
spec:
dependencies:
resources:
- ref: cart-cache
envBindings:
host: REDIS_HOST
port: REDIS_PORT
password: REDIS_PASSWORD # secret-backed; only the {name,key} pointer transits the control plane

See also