-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
In-place Resource Resize for Kubernetes (> 1.27) Pods is not working through Java client #3450
Comments
Two things.
|
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". In response to this:
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. |
Describe the bug
https://kubernetes.io/blog/2023/05/12/in-place-pod-resize-alpha/
In-place Resource Resize for Kubernetes (> 1.27) Pods is working when using the kubectl patch command as mentioned in the linked blog. Meaning the container's resources cpu/ memory get updated in-place without restarting or new containers being created.
I am following (https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/) to achieve similar functionality.
https://github.com/kubernetes-client/java/blob/master/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PatchExample.java
I tried PatchUtils.patch with
V1Patch body:
"[{ \"op\": \"replace\", \"path\": \"/spec/template/spec/containers/0/resources/limits/cpu\", \"value\": \"1\" }]"
for PATCH_FORMAT_JSON_PATCH. From the documentation it says that the new pods will be created.Would like to understand how to update in-place without the creation of new pods.
Client Version
20.0.1
Kubernetes Version
Client Version: v1.29.2
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.28.3
Java Version
Java 17
To Reproduce
https://github.com/kubernetes-client/java/blob/master/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/PatchExample.java
Try any of the patch deployment variations and you should see the pods getting created anew. Instead the pod spec has to be updated in-place.
Expected behavior
Pods should not get created anew but the cpu/memory resource requests and limits get updated in-place.
KubeConfig
apiVersion: apps/v1 kind: Deployment metadata: name: inplacedemo spec: replicas: 1 selector: matchLabels: app: inplacedemo template: metadata: labels: app: inplacedemo spec: containers: - name: inplacedemo image: alpine command: ["tail", "-f", "/dev/null"] resizePolicy: - resourceName: "memory" restartPolicy: "RestartContainer" resources: limits: cpu: 2 memory: "1Gi" requests: cpu: 1 memory: "500Mi"
Server (please complete the following information):
Additional context
I would like to achieve the equivalent of https://kubernetes.io/blog/2023/05/12/in-place-pod-resize-alpha/ using the java client.
The text was updated successfully, but these errors were encountered: