Agents for Environment Manager - Best Practices & Recommendations - Rafay Product Documentation

Best Practices - Environment Manager

Environment Execution and Worker Behavior

The environment provisioning and deprovisioning lifecycle can be divided into three high-level stages:

Environment Deploy/Delete

GitOps agent provisions workers (pods) to execute environment-related activities. By default, each agent can spin up to 10 workers as needed.


Sizing

Default Resource Requests and Limits per Worker:

Worker Type CPU Memory
Git Worker 250m 512Mi
OpenTofu Worker 500m 1Gi

Requests and limits are identical for each worker type.

Capacity Planning & Scaling

Cluster/Infrastructure Capacity

Scaling Recommendations

Sizing Calculations

To ensure efficient execution of activities during environment provisioning and deprovisioning, it's critical to size your agents appropriately. Here's a recommended approach to estimate agent capacity and determine the number of agents required, with built-in buffers and scheduling considerations.

Start Agent Sizing Process:

  1. Analyze Templates - Determine max parallel activities
  2. Estimate concurrent environments - Calculate total required workers
  3. Add buffer and determine agents - Optionally add extra agent for redundancy
  4. Evaluate republish frequency/stagger deployments
  5. Define autoscaling and placement - Finalize agent capacity plan

Step 1: Evaluate Maximum Parallel Activities per Template

Step 2: Determine Total Parallel Activities Across Environments

Step 3: Plan Agent Count and Buffers

Step 4: Consider Deployment Frequency and Staggering

Step 5: Define Auto-scaling Strategy and Pod Placement Policy


High Availability & Redundancy

To maintain reliability and ensure failover:


Pod Placement & Scheduling Behavior

Agent and Worker Pod Placement:


Agent Configuration Precedence

Agents can be configured at multiple levels:

When multiple configurations are defined, the following precedence order applies:

  1. Agent specified in the resource template (highest priority)
  2. Agent defined in the environment template
  3. Agent set at the environment level (lowest priority)