curl -L "https://kind.sigs.k8s.io/dl/v0.22.0/kind-$(uname)-amd64" -o /usr/local/bin/kind
chmod +x /usr/local/bin/kind
# cat kind.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
image: kindest/node:v1.29.0
- role: worker
image: kindest/node:v1.29.0
# kind create cluster --config kind.yaml
# cat nginx.yaml
apiVersion: v1
kind: Pod
metadata:
name: resize-test
spec:
containers:
- name: nginx
image: nginx:1.25.4
resources:
requests:
cpu: "250m"
memory: "128Mi"
limits:
cpu: "500m"
memory: "256Mi"
# kubectl apply -f nginx.yaml
resources:
requests:
- cpu: "250m"
+ cpu: "300m"
memory: "128Mi"
# kubectl apply -f nginx.yaml
The Pod "resize-test" 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)
...
kind delete cluster
# cat kind.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
featureGates:
"InPlacePodVerticalScaling": true
nodes:
- role: control-plane
image: kindest/node:v1.29.0
- role: worker
image: kindest/node:v1.29.0
# kind create cluster --config kind.yaml
kubectl apply -f nginx.yaml
resources:
requests:
- cpu: "300m"
+ cpu: "350m"
memory: "128Mi"
# kubectl apply -f nginx.yaml
# kubectl describe pod resize-test
...
Limits:
cpu: 500m
memory: 256Mi
Requests:
cpu: 350m
memory: 128Mi
...
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 2m59s default-scheduler Successfully assigned default/resize-test to kind-worker
Normal Pulling 2m58s kubelet Pulling image "nginx:1.25.4"
Normal Pulled 2m53s kubelet Successfully pulled image "nginx:1.25.4" in 5.292s (5.292s including waiting)
Normal Created 2m53s kubelet Created container nginx
Normal Started 2m53s kubelet Started container nginx