Skip to main content
A Deployment Rule lets you configure the lifecycle of your Environments by automating when and where resources are deployed across your infrastructure.

Benefits

Cost Optimization

Reduce your cloud costs up to 60% by using Deployment Rules through intelligent resource management during off-peak hours. Example: Automatically stop development environments outside business hours (nights and weekends) to eliminate unnecessary compute costs.

Time Savings

Automating environment lifecycle management eliminates manual configuration tasks, freeing developers to focus on core work. Example: Set rules once and let Qovery automatically start environments Monday morning and stop them Friday evening.

Use Cases

Shutting Down Environments

Stop development instances during non-working hours and weekends to eliminate unnecessary expenses. Common scenarios:
  • Stop dev/staging environments after 7 PM and restart at 8 AM
  • Shut down all preview environments on weekends
  • Pause ephemeral test environments after CI/CD runs complete

Multi-Provider Strategy

Deploy development workloads to budget-friendly cloud providers while maintaining production on premium services. Example: Run development on Scaleway (cost-effective) while keeping production on AWS (premium features).

Configuration Levels

Rules can be established at two hierarchical levels:

Project Level

  • Provides defaults automatically applied to newly created environments
  • Ensures consistent policies across all environments in a project
  • Can be overridden by environment-specific rules
Deployment rules at project level

Environment Level

  • Allows overriding project-level rules for specific environments
  • Gives fine-grained control for exceptions (e.g., keep staging running 24/7)
  • Takes precedence over project-level rules

Wildcard Patterns

Environment targeting supports wildcard patterns for flexible matching: Examples:
Use wildcards to create powerful rules that automatically apply to groups of environments without manual updates.

Rule Configuration Options

General Settings

  • Target Cluster: Specify which Kubernetes cluster the environment should deploy to
  • Environment Type: Set production, staging, or development classification
  • Wildcard Pattern: Define which environments this rule applies to

Start & Stop Controls

Define precise scheduling for deployment and teardown operations:
  • Auto-start: Schedule when environments should automatically start
  • Auto-stop: Schedule when environments should automatically shut down
  • Timezone: Set timezone for start/stop schedules
  • Days of week: Choose which days the rule applies
Example Schedule:

Priority Management

Multiple applicable rules follow a priority stack—rules are evaluated top-to-bottom, with highest-priority rules evaluated first.
Reorder deployment rule priority
How Priority Works:
  1. When an environment matches multiple rules, Qovery checks from top to bottom
  2. The first matching rule is applied
  3. Lower priority rules are ignored if a higher priority rule matches
Example Priority Order:
In this example:
  • prod-api matches Priority 1 → Never stops
  • staging-web matches Priority 2 → Stops on weekends
  • dev-test matches Priority 3 → Stops every night
Order matters! Always place more specific rules (like production exceptions) higher in the priority list than general catch-all rules.

Best Practices

Place specific rules (like production exceptions) at the top, followed by broader rules. This ensures critical environments aren’t accidentally matched by catch-all rules.
Use [PR]* patterns to automatically manage all preview environments created from pull requests without manual configuration.
Before applying rules to production-like environments, test them on development environments to ensure they work as expected.
Add clear descriptions to each rule explaining its purpose, especially for team environments where multiple people manage infrastructure.
As your infrastructure evolves, periodically review and update deployment rules to ensure they still match your needs.

Examples

Example 1: Cost-Saving Development Rule

Scenario: Stop all development environments outside business hours
Savings: ~60% reduction in compute costs for development environments

Example 2: Preview Environment Cleanup

Scenario: Automatically stop all PR preview environments overnight
Benefit: Reduces costs while ensuring fresh environments each morning

Example 3: Multi-Region Production

Scenario: Deploy production to high-performance cluster, staging to cost-effective cluster
Benefit: Balance performance and cost across environments

Next Steps

Environment Configuration

Learn more about environment settings

Project Configuration

Configure project-level settings

Deployment Pipeline

Understand deployment workflows

Auto-Deploy

Set up automatic deployments