Environment
An Environment represents a runtime context (e.g., dev, test, staging, production) where workloads are deployed and executed. Environments define deployment targets within a DataPlane and control environment-specific configurations like gateway settings and production flags.
API Versionβ
openchoreo.dev/v1alpha1
Resource Definitionβ
Metadataβ
Environments are namespace-scoped resources.
apiVersion: openchoreo.dev/v1alpha1
kind: Environment
metadata:
name: <environment-name>
namespace: <namespace> # Namespace for grouping environments
Spec Fieldsβ
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
dataPlaneRef | DataPlaneRef | No | - | Reference to the DataPlane or ClusterDataPlane where this environment is deployed |
isProduction | boolean | No | false | Indicates if this is a production environment |
gateway | GatewayConfig | No | - | Gateway configuration specific to this environment |
DataPlaneRefβ
Reference to a DataPlane or ClusterDataPlane where this environment is deployed.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
kind | string | No | DataPlane | Kind of the data plane (DataPlane or ClusterDataPlane) |
name | string | Yes | - | Name of the data plane resource |
If dataPlaneRef is not specified, the system resolves a DataPlane using the following fallback order:
- DataPlane named "default" in the Environment's namespace
- ClusterDataPlane named "default"
- First available DataPlane or ClusterDataPlane
When dataPlaneRef is provided, kind defaults to DataPlane if omitted. To reference a ClusterDataPlane, set kind explicitly to ClusterDataPlane.
GatewayConfigβ
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
dnsPrefix | string | No | "" | DNS prefix for the environment (e.g., "dev" for dev.example.com) |
security.remoteJwks.uri | string | No | "" | URI for remote JWKS endpoint for JWT validation |
Status Fieldsβ
| Field | Type | Default | Description |
|---|---|---|---|
observedGeneration | integer | 0 | The generation observed by the controller |
conditions | []Condition | [] | Standard Kubernetes conditions tracking the environment state |
Condition Typesβ
Common condition types for Environment resources:
Ready- Indicates if the environment is fully provisioned and readyDataPlaneConnected- Indicates if the environment is connected to its DataPlaneGatewayConfigured- Indicates if gateway configuration has been applied
Examplesβ
Development Environmentβ
apiVersion: openchoreo.dev/v1alpha1
kind: Environment
metadata:
name: development
namespace: default
spec:
dataPlaneRef:
kind: DataPlane
name: dev-dataplane
isProduction: false
gateway:
dnsPrefix: dev
security:
remoteJwks:
uri: https://auth.example.com/.well-known/jwks.json
Production Environmentβ
apiVersion: openchoreo.dev/v1alpha1
kind: Environment
metadata:
name: production
namespace: default
spec:
dataPlaneRef:
kind: DataPlane
name: prod-dataplane
isProduction: true
gateway:
dnsPrefix: api
security:
remoteJwks:
uri: https://auth.example.com/.well-known/jwks.json
Environment with ClusterDataPlaneβ
apiVersion: openchoreo.dev/v1alpha1
kind: Environment
metadata:
name: staging
namespace: default
spec:
dataPlaneRef:
kind: ClusterDataPlane
name: shared-dataplane
isProduction: false
gateway:
dnsPrefix: staging
Annotationsβ
Environments support the following annotations:
| Annotation | Description |
|---|---|
openchoreo.dev/display-name | Human-readable name for UI display |
openchoreo.dev/description | Detailed description of the environment |
Related Resourcesβ
- DataPlane - Kubernetes cluster hosting the environment
- ClusterDataPlane - Cluster-scoped data plane for shared environments
- DeploymentPipeline - Defines promotion paths between environments