-
Notifications
You must be signed in to change notification settings - Fork 15
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
Cluster graviton savings to non-graviton instances #852
Cluster graviton savings to non-graviton instances #852
Conversation
@@ -21,3 +21,31 @@ | |||
EC2_NAMESPACE = 'AWS/EC2' | |||
CLOUDWATCH_METRICS_AVAILABLE_DAYS = 14 | |||
AWS_DEFAULT_GLOBAL_REGION = 'us-east-1' | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we fetch it from AWS automatically and not use it manually ?
@@ -54,6 +56,8 @@ def run_policy_operations(self): | |||
else: | |||
running_instances = 1 | |||
creation_date = '' | |||
rosa_cluster = True if self.get_tag_name_from_tags(tags=tags, tag_name='red-hat-managed') else False | |||
using_graviton = True if '.g' in instance.get('InstanceType') else False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a1 is also graviton, is it good for cluster ?
32692de
to
27fd96d
Compare
instance_types_count = instance_types.count(instance_type) | ||
unit_price = self._resource_pricing.get_ec2_price(region_name=self._region, | ||
instance_type=instance_type) | ||
total_cost += unit_price * 24 * running_hours * instance_types_count |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unit_price * running_hours * instance_types_count
27fd96d
to
15761ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/LGTM
Type of change
Note: Fill x in []
Added the Gravtion savings, if the cluster is running the non-gravitation instances.
Description
For security reasons, all pull requests need to be approved first before running any automated CI