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
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
owner | ReleaseBindingOwner | Yes | - | Identifies the component this release binding applies to |
environment | string | Yes | - | Name of the environment (must match an Environment CR) |
releaseName | string | Yes | - | Name of the ComponentRelease to bind to this environment |
componentTypeEnvironmentConfigs | object | No | - | Overrides for ComponentType environmentConfigs parameters |
traitEnvironmentConfigs | map[string]object | No | - | Environment-specific trait parameter overrides |
workloadOverrides | WorkloadOverride | No | - | Overrides for workload configurations |
ReleaseBindingOwner
Identifies which component this release binding is for.
| Field | Type | Required | Description |
|---|---|---|---|
projectName | string | Yes | Name of the project that owns the component |
componentName | string | Yes | Name of the component to deploy |
releaseLine | string | No | ReleaseLine this binding deploys. Empty for the component's main line. A DNS label of at most 63 characters, other than main or default. The bound release must belong to the same line |
WorkloadOverride
Environment-specific configuration overrides for the workload.
| Field | Type | Required | Description |
|---|---|---|---|
container | ContainerOverride | No | Container-specific overrides |
ContainerOverride
| Field | Type | Required | Description |
|---|---|---|---|
env | [EnvVar] | No | Environment variable overrides |
files | [FileVar] | No | File configuration overrides |
EnvVar
| Field | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Environment variable name |
value | string | No | Plain text value |
secretKeyRef | SecretKeyRef | No | Reference to a secret value |
SecretKeyRef
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Name of the SecretKeyReference CR |
key | string | Yes | Key within the secret |
FileVar
| Field | Type | Required | Description |
|---|---|---|---|
key | string | Yes | File name |
mountPath | string | Yes | Mount path in container |
value | string | No | Plain text file content |
secretKeyRef | SecretKeyRef | No | Reference to a secret file |
Status Fields
| Field | Type | Default | Description |
|---|---|---|---|
conditions | []Condition | [] | Standard Kubernetes conditions tracking ReleaseBinding state |
endpoints | []EndpointURLStatus | [] | Resolved invoke URLs of the workload's named endpoints, set once the component is deployed |
Condition Types
Common condition types for ReleaseBinding resources:
Ready- Indicates if the release binding is readyDeployed- Indicates if resources have been deployed successfullySynced- Indicates if the deployment is in sync with the component definition
A binding of a release line also reports, on its ReleaseSynced and Ready conditions, ReleaseLineNotFound when its line does not exist, InvalidReleaseConfiguration when the line belongs to another component, ReleaseLineNameCollision when the line would render an object that another line of the component already renders, and ReleaseLinePodLabelOverlap when the line's pods would carry openchoreo.dev/component-uid or its objects would select pods on it. Such a binding is not deployed.
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 environmentConfigs 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
componentTypeEnvironmentConfigs:
resources:
requests:
cpu: "500m"
memory: "1Gi"
limits:
cpu: "2000m"
memory: "4Gi"
ReleaseBinding with Trait Environment Configs
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
traitEnvironmentConfigs:
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:
container:
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 environmentConfigs
componentTypeEnvironmentConfigs:
resources:
requests:
cpu: "500m"
memory: "1Gi"
limits:
cpu: "2000m"
memory: "4Gi"
# Override trait parameters
traitEnvironmentConfigs:
data-storage:
size: 100Gi
storageClass: fast-ssd
backup:
schedule: "0 2 * * *"
retention: 30
# Override workload configurations
workloadOverrides:
container:
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
occ apply -f my-service-development.yaml
# Staging environment
occ apply -f my-service-staging.yaml
# Production environment
occ apply -f my-service-production.yaml
View release bindings:
# List all release bindings
occ releasebinding list
# Get release bindings for a specific component
occ releasebinding list --component my-service
# View release binding details
occ releasebinding get my-service-production
Override Hierarchy
Parameters are resolved in the following order (later overrides earlier):
- ComponentType defaults - Default values from ComponentType schema
- Component parameters - Values specified in the Component spec
- 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
- Naming Convention: Use
<component-name>-<environment-name>pattern - Environment-Specific Values: Only override what differs between environments
- Resource Limits: Always set appropriate limits for production environments
- Configuration Management: Use ConfigMaps/Secrets for complex configurations
- Trait Management: Override trait parameters rather than removing/adding traits
- Testing: Validate overrides in lower environments before production
- Documentation: Document why specific overrides are needed
Related Resources
- 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
- ReleaseLine - Each line has at most one binding per environment