Skip to main content
Version: v0.5.x

ReleaseBinding

A ReleaseBinding represents an environment-specific deployment of a Component. It binds a specific release to an environment and allows platform engineers to override component parameters, trait configurations, and workload settings for specific environments like development, staging, or production.

API Version​

openchoreo.dev/v1alpha1

Resource Definition​

Metadata​

ReleaseBindings are namespace-scoped resources created in the same namespace as the Component they deploy.

apiVersion: openchoreo.dev/v1alpha1
kind: ReleaseBinding
metadata:
name: <component-name>-<environment-name>
namespace: <project-namespace>

Spec Fields​

FieldTypeRequiredDefaultDescription
ownerReleaseBindingOwnerYes-Identifies the component this release binding applies to
environmentstringYes-Name of the environment (must match an Environment CR)
releaseNamestringYes-Name of the ComponentRelease to bind to this environment
componentTypeEnvOverridesobjectNo-Overrides for ComponentType envOverrides parameters
traitOverridesmap[string]objectNo-Environment-specific trait parameter overrides
workloadOverridesWorkloadOverrideNo-Overrides for workload configurations

ReleaseBindingOwner​

Identifies which component this release binding is for.

FieldTypeRequiredDescription
projectNamestringYesName of the project that owns the component
componentNamestringYesName of the component to deploy

WorkloadOverride​

Environment-specific configuration overrides for the workload.

FieldTypeRequiredDescription
containersmap[string]ContainerOverrideNoContainer-specific overrides keyed by container name

ContainerOverride​

FieldTypeRequiredDescription
env[EnvVar]NoEnvironment variable overrides
files[FileVar]NoFile configuration overrides

EnvVar​

FieldTypeRequiredDescription
keystringYesEnvironment variable name
valuestringNoPlain text value
secretRefSecretRefNoReference to a secret value

SecretRef​

FieldTypeRequiredDescription
namestringYesName of the SecretReference CR
keystringYesKey within the secret

FileVar​

FieldTypeRequiredDescription
keystringYesFile name
mountPathstringYesMount path in container
valuestringNoPlain text file content
secretRefSecretRefNoReference to a secret file

Status Fields​

FieldTypeDefaultDescription
conditions[]Condition[]Standard Kubernetes conditions tracking ReleaseBinding state

Condition Types​

Common condition types for ReleaseBinding resources:

  • Ready - Indicates if the release binding is ready
  • Deployed - Indicates if resources have been deployed successfully
  • Synced - Indicates if the deployment is in sync with the component definition

Examples​

Basic ReleaseBinding​

apiVersion: openchoreo.dev/v1alpha1
kind: ReleaseBinding
metadata:
name: my-service-production
namespace: default
spec:
owner:
projectName: default
componentName: my-service

environment: production
releaseName: my-service-v1

ReleaseBinding with Parameter Overrides​

Override ComponentType envOverrides parameters for production:

apiVersion: openchoreo.dev/v1alpha1
kind: ReleaseBinding
metadata:
name: my-service-production
namespace: default
spec:
owner:
projectName: default
componentName: my-service

environment: production
releaseName: my-service-v1

componentTypeEnvOverrides:
resources:
requests:
cpu: "500m"
memory: "1Gi"
limits:
cpu: "2000m"
memory: "4Gi"

ReleaseBinding with Trait Overrides​

Override trait parameters for a specific environment:

apiVersion: openchoreo.dev/v1alpha1
kind: ReleaseBinding
metadata:
name: my-service-production
namespace: default
spec:
owner:
projectName: default
componentName: my-service

environment: production
releaseName: my-service-v1

traitOverrides:
data-storage: # instanceName of the trait attachment
size: 100Gi
storageClass: production-ssd
iops: 3000

ReleaseBinding with Workload Overrides​

Override workload environment variables and files:

apiVersion: openchoreo.dev/v1alpha1
kind: ReleaseBinding
metadata:
name: my-service-production
namespace: default
spec:
owner:
projectName: default
componentName: my-service

environment: production
releaseName: my-service-v1

workloadOverrides:
containers:
app:
env:
- key: LOG_LEVEL
value: "error"
- key: CACHE_TTL
value: "3600"

files:
- key: config.yaml
mountPath: /etc/app
value: |
database:
host: prod-db.example.com
port: 5432
cache:
enabled: true

Complete ReleaseBinding Example​

Combining all override types:

apiVersion: openchoreo.dev/v1alpha1
kind: ReleaseBinding
metadata:
name: my-service-production
namespace: default
spec:
owner:
projectName: default
componentName: my-service

environment: production
releaseName: my-service-v1

# Override ComponentType envOverrides
componentTypeEnvOverrides:
resources:
requests:
cpu: "500m"
memory: "1Gi"
limits:
cpu: "2000m"
memory: "4Gi"

# Override trait parameters
traitOverrides:
data-storage:
size: 100Gi
storageClass: fast-ssd

backup:
schedule: "0 2 * * *"
retention: 30

# Override workload configurations
workloadOverrides:
containers:
app:
env:
- key: LOG_LEVEL
value: "info"
- key: MAX_CONNECTIONS
value: "1000"

Usage​

ReleaseBindings are typically created for each environment where a component should be deployed:

# Development environment
kubectl apply -f my-service-development.yaml

# Staging environment
kubectl apply -f my-service-staging.yaml

# Production environment
kubectl apply -f my-service-production.yaml

View release bindings:

# List all release bindings
kubectl get releasebindings

# Get release bindings for a specific component
kubectl get releasebinding -l openchoreo.dev/component=my-service

# View release binding details
kubectl describe releasebinding my-service-production

Override Hierarchy​

Parameters are resolved in the following order (later overrides earlier):

  1. ComponentType defaults - Default values from ComponentType schema
  2. Component parameters - Values specified in the Component spec
  3. ReleaseBinding overrides - Environment-specific values in ReleaseBinding

Example:

# ComponentType defines: replicas default=1
# Component sets: replicas=3
# ReleaseBinding (prod) overrides: replicas=5
# Result: Production deployment will have 5 replicas

Best Practices​

  1. Naming Convention: Use <component-name>-<environment-name> pattern
  2. Environment-Specific Values: Only override what differs between environments
  3. Resource Limits: Always set appropriate limits for production environments
  4. Configuration Management: Use ConfigMaps/Secrets for complex configurations
  5. Trait Management: Override trait parameters rather than removing/adding traits
  6. Testing: Validate overrides in lower environments before production
  7. Documentation: Document why specific overrides are needed
  • Component - Defines the component being deployed
  • ComponentRelease - Immutable snapshot that ReleaseBinding references for deployment
  • Environment - Defines the target environment
  • ComponentType - Defines available parameters for override
  • Trait - Traits whose parameters can be overridden