Skip to content
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

[BUG] In place pod resource resize does not work on K8s 1.32, which launches 'resize' resubsource. #8999

Open
shanshanying opened this issue Mar 4, 2025 · 0 comments
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@shanshanying
Copy link
Contributor

shanshanying commented Mar 4, 2025

Kubernetes: v1.32.2

KubeBlocks cannot modify pod resources directly, instead, patch resize subresource to update.

The Pod "mypod" is invalid: spec: Forbidden: pod updates may not change fields other than `spec.containers[*].image`,`spec.initContainers[*].image`,`spec.activeDeadlineSeconds`,`spec.tolerations` (only additions to existing tolerations),`spec.terminationGracePeriodSeconds` (allow it to be set to 1 if it was previously negative)
  core.PodSpec{
  	Volumes:        {{Name: "kube-api-access-79z4n", VolumeSource: {Projected: &{Sources: {{ServiceAccountToken: &{ExpirationSeconds: 3607, Path: "token"}}, {ConfigMap: &{LocalObjectReference: {Name: "kube-root-ca.crt"}, Items: {{Key: "ca.crt", Path: "ca.crt"}}}}, {DownwardAPI: &{Items: {{Path: "namespace", FieldRef: &{APIVersion: "v1", FieldPath: "metadata.namespace"}}}}}}, DefaultMode: &420}}}},
  	InitContainers: nil,
  	Containers: []core.Container{
  		{
  			... // 6 identical fields
  			EnvFrom: nil,
  			Env:     nil,
  			Resources: core.ResourceRequirements{
  				Limits: core.ResourceList{
  					s"cpu":    {i: {...}, s: "1", Format: "DecimalSI"},
- 					s"memory": {i: resource.int64Amount{value: 1073741824}, s: "1Gi", Format: "BinarySI"},
+ 					s"memory": {i: resource.int64Amount{value: 524288000}, s: "500Mi", Format: "BinarySI"},
  				},
  				Requests: core.ResourceList{
  					s"cpu":    {i: {...}, s: "1", Format: "DecimalSI"},
- 					s"memory": {i: resource.int64Amount{value: 1073741824}, s: "1Gi", Format: "BinarySI"},
+ 					s"memory": {i: resource.int64Amount{value: 524288000}, s: "500Mi", Format: "BinarySI"},
  				},
  				Claims: nil,
  			},
  			ResizePolicy:  {{ResourceName: s"cpu", RestartPolicy: "NotRequired"}, {ResourceName: s"memory", RestartPolicy: "NotRequired"}},
  			RestartPolicy: nil,
  			... // 13 identical fields
  		},
  	},
  	EphemeralContainers: nil,
  	RestartPolicy:       "Always",
  	... // 29 identical fields
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant