Closed rgarcia89 closed 1 month ago
/assign /triage accepted
Quoting yourself from the issue you opened against Kubernetes:
A validation check within the Kubernetes API server to reject manifests with duplicate tolerations, ensuring adherence to Kubernetes best practices and avoiding potential issues related to duplicate toleration definitions would be great.
This is also what I would expect to be in the kube-apiserver. I don't think we should handle this scenario at kube-state-metrics' level since the object data is erroneous.
I am closing this issue in favor of the Kubernetes one. Feel free to reopen if the Kubernetes maintainers think we should handle this scenario here.
What happened: Starting with version 2.52.0, Prometheus introduced a mechanism to detect duplicate series during scraping. This can lead to error logs when kube-state-metrics scrapes metrics for deployments, particularly if there are duplicate entries within the toleration array.
prometheus debug logs:
There might be a need to deduplicate the toleration entries or add an index to entries with existing duplicates.
How to reproduce it (as minimally and precisely as possible):
create the following deployment and look at the metrics produced by kube-state-metrics
Anything else we need to know?: Issue report I opened on the prometheus project https://github.com/prometheus/prometheus/issues/14089
Environment:
kubectl version
): 1.27.9