While RealTheory uses optimization profiles to tailor right-sizing recommendations based on the intent of your workloads, optimization policies provide a dynamic, granular, and scalable mechanism for assigning those profiles to the appropriate clusters in your environment. Using a custom cluster label that you can easily associate with each cluster through the RealTheory Collector deployment YAML, you can minimize the need for excessive oversight and management. Optimization policies provide a highly efficient mechanism for managing your optimization strategy in large organizations with large numbers of clusters.
How Optimization Policies Work
Optimization policies define a relationship between clusters with a specific label that you specify and the optimization profile that is used to make the appropriate recommendations for workloads in cluster(s) with that label.
Example
Let's say that you have the following situation:
-
75% of your clusters are general-purpose and should use the Balanced profile
-
15% of your clusters are non-production and should be Cost Optimized
-
10% of your clusters are critical, production clusters, and must be Performance Optimized
In this scenario, you would set the Balanced profile as your default profile because a significant number of your clusters (75%) use that profile. Using that profile as your default minimizes the amount of configuration you need to implement.
You might then define the following labeling protocol to manage the automatic assignment of profiles to the appropriate clusters for the other strategies:
optimization-strategy=cost-optimized
optimization-strategy=performance-optimized
Note: You do not need a profile labeling convention for the clusters that will use the default profile.
When you define the RealTheory Collector deployment YAML for each of your clusters, you must add the appropriate optimization-strategy=<value> label to the deployment.
You then create an optimization policy for each optimization strategy that is an exception to the default strategy. Each policy will specify an optimization-strategy=<value> label as the Condition and the optimization profile that is appropriate for the cluster(s) that have the specified label.
How Policy Matching Works
-
Each policy includes a label selector and an associated Optimization Profile.
-
RealTheory evaluates the policy list from top to bottom.
-
The first policy with a label selector that matches a cluster is applied.
-
If no policy matches, the default policy (defined at the bottom) is used.
Note: Only one policy is applied per cluster—the first match wins.
See Also
How to Leverage RealTheory Labels For Scalability and Automation
How to Use Label Selectors to Identify Resources
Creating an Optimization Policy