Skip to main content

Resource Type

A ResourceType is to managed infrastructure what a ComponentType is to code. It's the template a developer references when they declare a Resource — a database, a queue, a cache — and it governs how that infrastructure is provisioned on the data plane and what it exposes back to consuming Workloads.

A ClusterResourceType is the cluster-scoped variant. The platform ships example ClusterResourceTypes (postgres, valkey, nats) backed by in-cluster StatefulSets — fine for development, but for production you author your own targeting a real provisioner (Crossplane, a cloud operator).

KindResourceType / ClusterResourceType
API groupopenchoreo.dev/v1alpha1
ScopeNamespaced / Cluster
AudiencePlatform engineer
Referenced byResource (spec.type)

Key spec fields

FieldWhat it does
spec.parameters.openAPIV3SchemaDeveloper-set values captured in the immutable ResourceRelease
spec.environmentConfigs.openAPIV3SchemaPer-environment overrides via the binding (memory, storage size)
spec.resources[]The Kubernetes manifests the provisioner emits, rendered with CEL (includeWhen, readyWhen)
spec.outputs[]Named values (host, port, password) consuming workloads bind into containers
spec.retainPolicyDefault deletion behavior — Delete or Retain

Outputs are the whole reason a ResourceType is useful — each has a unique name and one source: value (non-sensitive), secretKeyRef (credentials — only the {name,key} pointer leaves the data plane), or configMapKeyRef.

Create in the portal

  1. Open Create…Platform ResourcesClusterResourceType (or ResourceType for namespace scope).
  2. In the in-portal YAML editor, define the parameter / environment schemas, the resources, the outputs, and retainPolicy.
  3. Click Create. Developers can now declare a Resource of this type.

Full guide: Resource types.

Example

A valkey-cache ResourceType exposing host, port, and password:

apiVersion: openchoreo.dev/v1alpha1
kind: ResourceType
metadata:
name: valkey-cache
namespace: fedshi
spec:
parameters:
openAPIV3Schema:
type: object
properties:
version: { type: string, enum: ["7", "8"], default: "8" }
environmentConfigs:
openAPIV3Schema:
type: object
properties:
memory: { type: string, default: "128Mi" }
retainPolicy: Delete
outputs:
- name: host
value: "${metadata.name}.${metadata.namespace}.svc.cluster.local"
- name: port
value: "6379"
- name: password
secretKeyRef: # credential stays on the data plane
name: "${metadata.name}-creds"
key: password
resources:
- id: statefulset
# … StatefulSet template rendered with CEL …

See also