Skip to content

Support for resize subresource in Kubernetes C# client #1641

Closed

Description

@aliridahussein

Feature Request

Please add support for the resize subresource in the Kubernetes C# client to enable in-place Pod resource updates (CPU/memory) without requiring a restart.

Background

Kubernetes v1.33 introduced the resize subresource (beta) to allow in-place vertical scaling of Pods. This is accessible via:

bash
kubectl edit pod --subresource=resize

However, the C# client currently does not expose this subresource, making it difficult to automate in-place scaling from .NET applications.

Use Case

We want to programmatically resize Pods without restarting them, using the C# client. This is especially useful for performance-sensitive workloads where downtime is not acceptable.

References

Kubernetes enhancement: kubernetes/enhancements#1287
API reference: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.33/#pod-v1-core

Suggested Implementation

Expose a method like:
await client.PatchNamespacedPodResizeAsync(...);
Or allow specifying subresources in existing patch methods.

Activity

  1. brendandburns commented on Jul 29, 2025

    @brendandburns
    Contributor

    I think we just need to regenerate the client for 1.33 and we should pick this up (unless somehow it is missing from the api specification)

  2. tg123 commented on Jul 29, 2025

    @tg123
    Member

    let me check

  3. aliridahussein commented on Jul 30, 2025

    @aliridahussein
    Author

    Hi all,

    I confirmed that the v1.33+ OpenAPI spec already defines the resize sub‑resource in api__v1_openapi.json:

    "/api/v1/namespaces/{namespace}/pods/{name}/resize": {
    "patch": {
    "description": "partially update resize of the specified Pod",
    "operationId": "patchCoreV1NamespacedPodResize",
    …
    }
    }

    This means no changes to the spec are needed, once the C# client is regenerated against this spec, it will automatically include a PatchNamespacedPodResizeAsync (or the PatchNamespacedPodAsync(..., subresource: "resize") overload).

    Do you have an estimated timeline for when the client will be regenerated and a new release published with this method?

    Thanks!

  4. self-assigned this
    on Aug 28, 2025
  5. tg123 commented on Sep 1, 2025

    @tg123
    Member

    just confirmed, those api are already generated
    add example of resize

  6. locked and limited conversation to collaborators on Sep 5, 2025
  7. converted this issue into a discussion #1660 on Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions