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 | GatewaySpec | 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.
GatewaySpecβ
Gateway configuration for the environment.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
ingress | GatewayNetworkSpec | No | - | Ingress gateway configuration |
egress | GatewayNetworkSpec | No | - | Egress gateway configuration |
GatewayNetworkSpecβ
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
external | GatewayEndpointSpec | No | - | External gateway endpoint configuration |
internal | GatewayEndpointSpec | No | - | Internal gateway endpoint configuration |
GatewayEndpointSpecβ
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | Yes | - | Name of the Kubernetes Gateway resource |
namespace | string | Yes | - | Namespace of the Kubernetes Gateway resource |
http | GatewayListenerSpec | No | - | HTTP listener configuration |
https | GatewayListenerSpec | No | - | HTTPS listener configuration |
tls | GatewayListenerSpec | No | - | TLS listener configuration |
GatewayListenerSpecβ
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
listenerName | string | No | - | Name of the listener on the Gateway |
port | integer | Yes | - | Port number for the listener |
host | string | Yes | - | Hostname for the listener |
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β
A simple development environment with just a DataPlane reference:
apiVersion: openchoreo.dev/v1alpha1
kind: Environment
metadata:
name: development
namespace: default
spec:
dataPlaneRef:
kind: DataPlane
name: dev-dataplane
isProduction: false
Production Environmentβ
A production environment with gateway configuration:
apiVersion: openchoreo.dev/v1alpha1
kind: Environment
metadata:
name: production
namespace: default
spec:
dataPlaneRef:
kind: DataPlane
name: prod-dataplane
isProduction: true
gateway:
ingress:
external:
name: external-gateway
namespace: gateway-system
https:
listenerName: https
port: 443
host: api.example.com
internal:
name: internal-gateway
namespace: gateway-system
http:
listenerName: http
port: 80
host: internal.example.com
Environment with ClusterDataPlaneβ
apiVersion: openchoreo.dev/v1alpha1
kind: Environment
metadata:
name: staging
namespace: default
spec:
dataPlaneRef:
kind: ClusterDataPlane
name: shared-dataplane
isProduction: false
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