Skip to main content
Version: Next

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
gatewayGatewayConfigNo-Gateway configuration specific to this environment

DataPlaneRef​

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

FieldTypeRequiredDefaultDescription
kindstringNoDataPlaneKind 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, kind defaults to DataPlane if omitted. To reference a ClusterDataPlane, set kind explicitly to ClusterDataPlane.

GatewayConfig​

FieldTypeRequiredDefaultDescription
dnsPrefixstringNo""DNS prefix for the environment (e.g., "dev" for dev.example.com)
security.remoteJwks.uristringNo""URI for remote JWKS endpoint for JWT validation

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​

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:

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