Skip to content

KEP 1287: Instrumentation for in-place pod resize #5340

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

natasha41575
Copy link
Contributor

  • One-line PR description:
    • Add section with details about the metrics we plan to instrument for IPPR

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 23, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: natasha41575
Once this PR has been reviewed and has the lgtm label, please assign derekwaynecarr for approval. For more information see the Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/node Categorizes an issue or PR as relevant to SIG Node. labels May 23, 2025
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 23, 2025
Labels:
- `resource_type` - what type of resource is being resized. Possible values: `cpu_limits`, `cpu_requests` `memory_limits`, or `memory_requests`. If more than one of these resource types is changing in the resize request,
we increment the counter multiple times, once for each. This means that a single pod update changing multiple
resource types will be considered multiple requests for this metric.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ig this is a little weird but I'm not sure if the alternatives are better. We also already have apiserver_request_total{resource=pods,subresource=resize} if we just want the raw total number of resize requests to the api server

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I agree. Maybe worth asking the sig-instrumentation folks for advice?

- `resource_type` - what type of resource is being resized. Possible values: `cpu_limits`, `cpu_requests` `memory_limits`, or `memory_requests`. If more than one of these resource types is changing in the resize request,
we increment the counter multiple times, once for each. This means that a single pod update changing multiple
resource types will be considered multiple requests for this metric.
- `operation_type` - whether the resize is an increase or a decrease. Possible values: `increase`, `decrease`, `add`, or `remove`.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming requests / limits can be added to a container but I don't actually know if that's true?? (I know kubernetes/kubernetes#127143 is adding support to remove them)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, can be added. Except memory limits because that would count as a memory limit decrease (which we don't currently allow), but we'll lift that restriction.


#### `kubelet_pod_resize_requests_total`

This metric tracks the total number of resize requests observed by the Kubelet, counted at the pod level.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @ndixita

I don't have all the context but we might want to revisit or reuse this metric in the context of pod-level resources when resize of pod-level resources is supported

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without pod-level resources, is this just based on the net-change across all containers? What happens if 2 containers are resized, but the net change is 0?

I'm wondering whether we should skip this metric for now, and only record it in the context of pod-level resources?

@natasha41575
Copy link
Contributor Author

/assign @tallclair

Labels:
- `resource_type` - what type of resource is being resized. Possible values: `cpu_limits`, `cpu_requests` `memory_limits`, or `memory_requests`. If more than one of these resource types is changing in the resize request,
we increment the counter multiple times, once for each. This means that a single pod update changing multiple
resource types will be considered multiple requests for this metric.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I agree. Maybe worth asking the sig-instrumentation folks for advice?

- `resource_type` - what type of resource is being resized. Possible values: `cpu_limits`, `cpu_requests` `memory_limits`, or `memory_requests`. If more than one of these resource types is changing in the resize request,
we increment the counter multiple times, once for each. This means that a single pod update changing multiple
resource types will be considered multiple requests for this metric.
- `operation_type` - whether the resize is an increase or a decrease. Possible values: `increase`, `decrease`, `add`, or `remove`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, can be added. Except memory limits because that would count as a memory limit decrease (which we don't currently allow), but we'll lift that restriction.


#### `kubelet_pod_resize_requests_total`

This metric tracks the total number of resize requests observed by the Kubelet, counted at the pod level.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without pod-level resources, is this just based on the net-change across all containers? What happens if 2 containers are resized, but the net change is 0?

I'm wondering whether we should skip this metric for now, and only record it in the context of pod-level resources?

Comment on lines +928 to +930
- `resource_type` - what type of resource is being resized. Possible values: `cpu_limits`, `cpu_requests` `memory_limits`, or `memory_requests`. If more than one of these resource types is changing in the resize request,
we increment the counter multiple times, once for each.
- `operation_type` - whether the resize is an increase or a decrease. Possible values: `increase`, `decrease`, `add`, or `remove`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like useful data, but I think including these dimensions will require tracking some historical context for the pod resources? At the time we deem the resize complete, we don't currently know what changed. WDYT?


This metric is recorded as a gauge.

#### `kubelet_pod_infeasible_resize_total`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we count deferred resizes too?

Comment on lines +954 to +955
This metric tracks the total number of resize requests that the Kubelet originally marked as deferred but
later accepted. This metric primarily exists because if a deferred resize is accepted through the timed retry as
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have sufficient information to distinguish between a deferred resize that was accepted, and a deferred resize that was overwritten with a new feasible size?

resizes that we should fix.

Labels:
- `retry_reason` - whether the resize was accepted through the timed retry or explicitly signaled. Possible values: `timed`, `signaled`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this mean?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/node Categorizes an issue or PR as relevant to SIG Node. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants