Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add schedule-based quotas policy #1250

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

karthikmanam
Copy link

This policy automatically adjusts resource quotas based on time schedules to optimize cloud costs. During non-business hours and weekends, the policy reduces resource quotas to prevent over provisioning.

Key features:

  • Automatically adjusts quotas based on business hours (9 AM - 5 PM PT)
  • Reduces resource limits during off-hours and weekends
  • Includes comprehensive Chainsaw tests for time-based scenarios
  • Helps organizations optimize cloud costs

The policy uses time-based conditions to:

  • Set higher limits (CPU: 20, Memory: 40Gi) during business hours
  • Set lower limits (CPU: 10, Memory: 20Gi) during non-business hours
  • Includes tests for business hours, after hours, and weekends

Related Issue(s)

Addresses the need for automated cost optimization through time-based resource management.

Description

Add Schedule-based Resource Quotas Policy

This PR introduces a new policy that automatically adjusts resource quotas based on time schedules to optimize cloud costs. The policy helps organizations reduce resource consumption during non-business hours while maintaining higher limits during peak business hours.

Policy Details

The policy implements time-based resource quota management:

Business Hours (Mon-Fri, 9 AM - 5 PM PT)

  • CPU: 20 cores
  • Memory: 40Gi

Non-Business Hours & Weekends

  • CPU: 10 cores
  • Memory: 20Gi

Features

  • 🕒 Automatic quota adjustment based on business hours
  • 💰 Cost optimization through dynamic resource limits
  • 🔄 Seamless transitions between business and non-business hours
  • 🧪 Comprehensive Chainsaw tests for all scenarios

Testing

The policy includes Chainsaw tests for:

  1. Business hours quota adjustment
  2. Non-business hours quota adjustment
  3. Weekend quota adjustment

Use Cases

  • Development/staging environments that need fewer resources outside business hours
  • Cost optimization for non-critical workloads
  • Automated resource management based on usage patterns

Checklist

  • I have read the policy contribution guidelines.
  • I have added test manifests and resources covering both positive and negative tests that prove this policy works as intended.
  • I have added the artifacthub-pkg.yml file and have verified it is complete and correct.

This policy automatically adjusts resource quotas based on time schedules
to optimize cloud costs. During non-business hours and weekends, the policy
reduces resource quotas to prevent overprovisioning.

Key features:
- Automatically adjusts quotas based on business hours (9 AM - 5 PM PT)
- Reduces resource limits during off-hours and weekends
- Includes comprehensive Chainsaw tests for time-based scenarios
- Helps organizations optimize cloud costs

The policy uses time-based conditions to:
- Set higher limits (CPU: 20, Memory: 40Gi) during business hours
- Set lower limits (CPU: 10, Memory: 20Gi) during non-business hours
- Includes tests for business hours, after hours, and weekends

Signed-off-by: Karthik babu Manam <[email protected]>
@karthikmanam
Copy link
Author

@realshuting Could you please take a look at this as well? Appreciate much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant