-
Notifications
You must be signed in to change notification settings - Fork 2k
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
feat: Adds category label for unschedulable pod as part of kube_pod_status_unschedulable
metric
#2571
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ilaylow The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This issue is currently awaiting triage. If kube-state-metrics contributors determine this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Welcome @ilaylow! |
kube_pod_status_unschedulable
metrickube_pod_status_unschedulable
metric
kube_pod_status_unschedulable
metrickube_pod_status_unschedulable
metric
Thanks for the PR. We omitted the message on purpose as it can cause high cardinality due to the fact it's not limited to a specific set of messages, so this is a feature we cannot include. |
Ah I figured that would be the case. Would you be open to me introducing categorisation to a limited set of values then? What I'm really looking to get out of this is a way to distinguish between whether a pod was unschedulable due to insufficient resources, or due to pod affinities etc. |
I added a naive example implementation in my latest commit 99d0fb6 to address the cardinality issue, could I get your thoughts on this? |
kube_pod_status_unschedulable
metrickube_pod_status_unschedulable
metric
KMS is direct mapping of Kubernetes object to metrics, it exposes the data as is without any modification. Also, maintaining an updated list of categories would be quite painful from a maintainer perspective |
What this PR does / why we need it:
This PR allows us to determine if a pod's reason for being unschedulable by introducing a custom
category
label:RESOURCE
- Pod is unschedulable due to insufficient resources.AFFINITY
- Pod is unschedulable due to pod affinity.UNKNOWN
- Pod is unschedulable due to unknown reasons.The
category
is derived from making assumptions on the thePodCondition.Message
value (see below).How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality)
Increases cardinality mildly due to the addition of a label with 3 dimensions.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):(No ongoing issue)