Skip to main content
Version: v1.0.0-rc.2 (pre-release)

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​

FieldTypeRequiredDefaultDescription
dataPlaneRefDataPlaneRefNo-Reference to the DataPlane or ClusterDataPlane where this environment is deployed
isProductionbooleanNofalseIndicates if this is a production environment
gatewayGatewaySpecNo-Gateway configuration specific to this environment

DataPlaneRef​

Reference to a DataPlane or ClusterDataPlane where this environment is deployed.

FieldTypeRequiredDefaultDescription
kindstringYes-Kind of the data plane (DataPlane or ClusterDataPlane)
namestringYes-Name of the data plane resource
DataPlaneRef Resolution

If dataPlaneRef is not specified, the system resolves a DataPlane using the following fallback order:

  1. DataPlane named "default" in the Environment's namespace
  2. ClusterDataPlane named "default"
  3. First available DataPlane or ClusterDataPlane

When dataPlaneRef is provided, both kind and name are required. Set kind to DataPlane or ClusterDataPlane.

GatewaySpec​

Gateway configuration for the environment.

FieldTypeRequiredDefaultDescription
ingressGatewayNetworkSpecNo-Ingress gateway configuration
egressGatewayNetworkSpecNo-Egress gateway configuration

GatewayNetworkSpec​

FieldTypeRequiredDefaultDescription
externalGatewayEndpointSpecNo-External gateway endpoint configuration
internalGatewayEndpointSpecNo-Internal gateway endpoint configuration

GatewayEndpointSpec​

FieldTypeRequiredDefaultDescription
namestringYes-Name of the Kubernetes Gateway resource
namespacestringYes-Namespace of the Kubernetes Gateway resource
httpGatewayListenerSpecNo-HTTP listener configuration
httpsGatewayListenerSpecNo-HTTPS listener configuration
tlsGatewayListenerSpecNo-TLS listener configuration

GatewayListenerSpec​

FieldTypeRequiredDefaultDescription
listenerNamestringNo-Name of the listener on the Gateway
portintegerYes-Port number for the listener
hoststringYes-Hostname for the listener

Status Fields​

FieldTypeDefaultDescription
observedGenerationinteger0The 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 ready
  • DataPlaneConnected - Indicates if the environment is connected to its DataPlane
  • GatewayConfigured - 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:

AnnotationDescription
openchoreo.dev/display-nameHuman-readable name for UI display
openchoreo.dev/descriptionDetailed description of the environment