krr: Krr 1.5.3 returns no results due to no metrics for PercentileCPULoader and MaxMemoryLoader
Describe the bug
I updated the tool to the 1.5.3 version. When I executed the simple strategy and it returned no results:
> krr simple --namespace <namespace> --selector="app = grafana"
_____ _ _ _ _______ _____
| __ \ | | | | | |/ / __ \| __ \
| |__) |___ | |__ _ _ ___| |_ __ _ | ' /| |__) | |__) |
| _ // _ \| '_ \| | | / __| __/ _` | | < | _ /| _ /
| | \ \ (_) | |_) | |_| \__ \ || (_| | | . \| | \ \| | \ \
|_| \_\___/|_.__/ \__,_|___/\__\__,_| |_|\_\_| \_\_| \_\
Running Robusta's KRR (Kubernetes Resource Recommender) v1.5.3
Using strategy: Simple
Using formatter: table
[INFO] Using clusters: ['<cluster>']
on 0: [INFO] Listing scannable objects in <cluster>
on 0: [INFO] Connecting to Prometheus for <cluster> cluster
on 0: [INFO] Using Prometheus at https://<server>/api/v1/namespaces/<namespace>/services/prometheus-server-service:9091/proxy for cluster <cluster>
on 0: [INFO] Prometheus found
on 0: [INFO] Prometheus connected successfully for <cluster> cluster
on 0: [WARNING] Prometheus returned no PercentileCPULoader metrics for Deployment <namespace>/grafana-deployment/grafana
on 0: [WARNING] Prometheus returned no MaxMemoryLoader metrics for Deployment <namespace>/grafana-deployment/grafana
Calculating Recommendation |████████████████████████████████████████| 1 in 15.4s (0.07/s)
Simple Strategy
CPU request: 99.0% percentile, limit: unset
Memory request: max + 5.0%, limit: max + 5.0%
This strategy does not work with objects with HPA defined (Horizontal Pod Autoscaler).
If HPA is defined for CPU or Memory, the strategy will return "?" for that resource.
Learn more: https://github.com/robusta-dev/krr#algorithm
┏━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┓
┃ Number ┃ Namespace ┃ Name ┃ Pods ┃ Old Pods ┃ Type ┃ Container ┃ CPU Diff ┃ CPU Requests ┃ CPU Limits ┃ Memory Diff ┃ Memory Requests ┃ Memory Limits ┃
┡━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━┩
│ 1. │ <namespace> │ grafana-deploym… │ 0 │ 0 │ Deployment │ grafana │ │ 40m -> ? (No │ unset -> ? (No │ │ 75Mi -> ? (No │ 90Mi -> ? (No │
│ │ │ │ │ │ │ │ │ data) │ data) │ │ data) │ data) │
└────────┴──────────────────┴──────────────────┴──────┴──────────┴────────────┴───────────┴──────────┴──────────────────┴──────────────────┴─────────────┴──────────────────┴───────────────────┘
100 points - A
When I execute the same command for the same cluster with the 1.4.1 version, it works fine:
> krr simple --namespace monitor-operator --selector="app = grafana"
_____ _ _ _ _______ _____
| __ \ | | | | | |/ / __ \| __ \
| |__) |___ | |__ _ _ ___| |_ __ _ | ' /| |__) | |__) |
| _ // _ \| '_ \| | | / __| __/ _` | | < | _ /| _ /
| | \ \ (_) | |_) | |_| \__ \ || (_| | | . \| | \ \| | \ \
|_| \_\___/|_.__/ \__,_|___/\__\__,_| |_|\_\_| \_\_| \_\
Running Robusta's KRR (Kubernetes Resource Recommender) v1.4.1
Using strategy: Simple
Using formatter: table
[INFO] Using clusters: ['<cluster>']
[INFO] Listing scannable objects in <cluster>
[INFO] Found 1 objects across 1 namespaces in <cluster>
on 0: [INFO] Connecting to Prometheus for <cluster> cluster
on 0: [INFO] Using Prometheus at https://<server>/api/v1/namespaces/<namespace>/services/prometheus-server-service:9091/proxy for cluster <cluster>
on 0: [INFO] Prometheus found
on 0: [INFO] Prometheus connected successfully for <cluster> cluster
Calculating Recommendation |████████████████████████████████████████| 1/1 [100%] in 5.5s (0.18/s)
Simple Strategy
CPU request: 99.0% percentile, limit: unset
Memory request: max + 5.0%, limit: max + 5.0%
This strategy does not work with objects with HPA defined (Horizontal Pod Autoscaler).
If HPA is defined for CPU or Memory, the strategy will return "?" for that resource.
Learn more: https://github.com/robusta-dev/krr#algorithm
┏━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Number ┃ Namespace ┃ Name ┃ Pods ┃ Old Pods ┃ Type ┃ Container ┃ CPU Diff ┃ CPU Requests ┃ CPU Limits ┃ Memory Diff ┃ Memory Requests ┃ Memory Limits ┃
┡━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ 1. │ <namespace> │ grafana-deployment │ 1 │ 0 │ Deployment │ grafana │ -35m │ (-35m) 40m -> 5m │ unset │ -15Mi │ (-15Mi) 75Mi -> 60Mi │ 90Mi -> 60Mi │
└────────┴──────────────────┴────────────────────┴──────┴──────────┴────────────┴───────────┴──────────┴──────────────────┴────────────┴─────────────┴──────────────────────┴───────────────┘
100 points - A
To Reproduce Steps to reproduce the behavior:
- execute the simple strategy only with the namespace and selector parameters
Expected behavior
Recommendations should be calculated.
Desktop
- OS: Microsoft Windows 11 Enterprise, 10.0.22621
- Browser: Brave, 1.56.20 Chromium: 115.0.5790.171 (Official Build) (64-bit)
About this issue
- Original URL
- State: closed
- Created 10 months ago
- Reactions: 2
- Comments: 15
similar issue with
Google Cloud Managed Prometheus,1.60-alphadoes not work for me. Had to downgrade to1.4.1kube_pod_ownerdoes not exist as a metric.Logs
Hi @LeaveMyYard. I apologize for the delay, but I was on vacation. I tested with
1.60-alphaand it does not work:Hey, @agabrys
Can you try the code from #128 ?