Skip to main content

Working with Environments

Environments are the core concept in OpenPrime. Each environment represents a complete infrastructure configuration that can be deployed to a cloud provider.

Environment Structure​

An environment contains:

name: production-us-east
provider: aws
region: us-east-1
configuration:
# Provider-specific settings
services:
kubernetes: { enabled: true, ... }
database: { enabled: true, ... }
helmCharts:
nginx-ingress: { enabled: true, ... }

Creating Environments​

Via the UI​

  1. Navigate to Environments in the sidebar
  2. Click Create Environment
  3. Complete the wizard:
    • Basic info (name, provider, region)
    • Services configuration
    • Helm charts selection
    • Review and save

Environment Naming​

Use descriptive, consistent names:

# Good
production-us-east
staging-eu-west
dev-team-alpha

# Avoid
env1
my-environment
test

Managing Services​

Enabling Services​

Each service has an enabled flag and configuration options:

services:
kubernetes:
enabled: true
clusterName: my-cluster
version: "1.28"

Service Dependencies​

Some services have dependencies:

ServiceRequires
Helm ChartsKubernetes
IngressKubernetes
Service MeshKubernetes

OpenPrime validates dependencies before saving.

Environment Lifecycle​

States​

StateDescription
DraftBeing configured, not deployed
ActiveConfiguration saved, ready to deploy
DeployedInfrastructure provisioned
ArchivedNo longer active, retained for history

Operations​

  • Edit - Modify configuration
  • Clone - Create copy with new name
  • Export - Download configuration as JSON/YAML
  • Archive - Soft delete, can be restored
  • Delete - Permanent removal

Best Practices​

Environment Parity​

Keep development, staging, and production similar:

# Use the same structure, different scale
development:
nodeCount: 1
instanceType: t3.small

staging:
nodeCount: 2
instanceType: t3.medium

production:
nodeCount: 5
instanceType: t3.large

Version Control​

Export and commit environment configurations:

# Export environment
curl -H "Authorization: Bearer $TOKEN" \
http://localhost:3001/api/environments/123/export \
> environments/production.json

Tagging​

Use consistent tags for cost allocation and organization:

configuration:
tags:
Environment: production
Team: platform
CostCenter: infrastructure