google / gke-policy-automation

Tool and policy library for reviewing Google Kubernetes Engine clusters against best practices
Apache License 2.0
512 stars 26 forks source link

Scalability: add actuals and limits to the policy model #177

Open mikouaj opened 1 year ago

mikouaj commented 1 year ago

Community Note

Description

The goal of this feature is to add reporting of the actual value and limits in the policy model after the cluster evaluation. This makes most sense for scalability checks, when user would like to know the actual values and limits, in the evaluation report, even when policy is valid.

From the user perspective, the current console output for a valid scalability policy looks like this:

🔎 [Scalability] gke.scalability.pods: Number of PODs in a cluster
  - projects/gke-policy-demo/locations/europe-central2/clusters/cluster-waw                [ OK ]

With the feature implemented, it could look like below:

🔎 [Scalability] gke.scalability.pods: Number of PODs in a cluster
  - projects/gke-policy-demo/locations/europe-central2/clusters/cluster-waw                [ 120 out of 300k ]

The 120 out of 300k would reman printed in a green colour. In a JSON report, the policy will be valid isValid: true but new fields, actuals and limit will be present.

References

N/A