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​
- Navigate to Environments in the sidebar
- Click Create Environment
- 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:
| Service | Requires |
|---|---|
| Helm Charts | Kubernetes |
| Ingress | Kubernetes |
| Service Mesh | Kubernetes |
OpenPrime validates dependencies before saving.
Environment Lifecycle​
States​
| State | Description |
|---|---|
| Draft | Being configured, not deployed |
| Active | Configuration saved, ready to deploy |
| Deployed | Infrastructure provisioned |
| Archived | No 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