Skip to content

Commit c014f72

Browse files
tallclairtengqm
andauthored
Update InPlacePodVerticalScaling docs for v1.33 beta (#50290)
* Update InPlacePodVerticalScaling docs for v1.33 beta * Add reference to subresources for updating pods in pods doc * Document allocation_manager checkpoint files * Cross-reference resource resizing from CPU & memory assignment tasks * Add note about resizing to the downward API reference * Update VPA in-place resizing section * Update _index.md * Update downward-api.md * Update InPlacePodVerticalScaling.md * Update kubelet-files.md * Update resize-container-resources.md * Update autoscaling.md --------- Co-authored-by: Qiming Teng <tengqm@outlook.com>
1 parent 88bb575 commit c014f72

File tree

9 files changed

+249
-207
lines changed

9 files changed

+249
-207
lines changed

‎content/en/docs/concepts/workloads/autoscaling.md

+10-12
Original file line numberDiff line numberDiff line change
@@ -71,21 +71,19 @@ At the moment, the VPA can operate in four different modes:
7171
{{< table caption="Different modes of the VPA" >}}
7272
Mode | Description
7373
:----|:-----------
74-
`Auto` | Currently, `Recreate` might change to in-place updates in the future
74+
`Auto` | Currently `Recreate`. This might change to in-place updates in the future.
7575
`Recreate` | The VPA assigns resource requests on pod creation as well as updates them on existing pods by evicting them when the requested resources differ significantly from the new recommendation
7676
`Initial` | The VPA only assigns resource requests on pod creation and never changes them later.
7777
`Off` | The VPA does not automatically change the resource requirements of the pods. The recommendations are calculated and can be inspected in the VPA object.
7878
{{< /table >}}
7979

80-
#### Requirements for in-place resizing
80+
#### In-place pod vertical scaling
8181

8282
{{< feature-state feature_gate_name="InPlacePodVerticalScaling" >}}
8383

84-
Resizing a workload in-place **without** restarting the {{< glossary_tooltip text="Pods" term_id="pod" >}}
85-
or its {{< glossary_tooltip text="Containers" term_id="container" >}} requires Kubernetes version 1.27 or later.
86-
Additionally, the `InPlaceVerticalScaling` feature gate needs to be enabled.
87-
88-
{{< feature-gate-description name="InPlacePodVerticalScaling" >}}
84+
As of Kubernetes {{< skew currentVersion >}}, VPA does not support resizing pods in-place,
85+
but this integration is being worked on.
86+
For manually resizing pods in-place, see [Resize Container Resources In-Place](/docs/tasks/configure-pod-container/resize-container-resources/).
8987

9088
### Autoscaling based on cluster size
9189

@@ -102,9 +100,9 @@ If the number of replicas should stay the same, you can scale your workloads ver
102100
the [_Cluster Proportional Vertical Autoscaler_](https://github.com/kubernetes-sigs/cluster-proportional-vertical-autoscaler).
103101
The project is **currently in beta** and can be found on GitHub.
104102

105-
While the Cluster Proportional Autoscaler scales the number of replicas of a workload, the Cluster Proportional Vertical Autoscaler
106-
adjusts the resource requests for a workload (for example a Deployment or DaemonSet) based on the number of nodes and/or cores
107-
in the cluster.
103+
While the Cluster Proportional Autoscaler scales the number of replicas of a workload,
104+
the Cluster Proportional Vertical Autoscaler adjusts the resource requests for a workload
105+
(for example a Deployment or DaemonSet) based on the number of nodes and/or cores in the cluster.
108106

109107
### Event driven Autoscaling
110108

@@ -121,8 +119,8 @@ Another strategy for scaling your workloads is to **schedule** the scaling opera
121119
reduce resource consumption during off-peak hours.
122120

123121
Similar to event driven autoscaling, such behavior can be achieved using KEDA in conjunction with
124-
its [`Cron` scaler](https://keda.sh/docs/latest/scalers/cron/). The `Cron` scaler allows you to define schedules
125-
(and time zones) for scaling your workloads in or out.
122+
its [`Cron` scaler](https://keda.sh/docs/latest/scalers/cron/).
123+
The `Cron` scaler allows you to define schedules (and time zones) for scaling your workloads in or out.
126124

127125
## Scaling cluster infrastructure
128126

‎content/en/docs/concepts/workloads/pods/_index.md

+25-4
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,21 @@ have some limitations:
245245
1. updating the field from a positive number to a smaller, non-negative
246246
number.
247247

248+
### Pod subresources
249+
250+
The above update rules apply to regular pod updates, but other pod fields can be updated through _subresources_.
251+
252+
- **Resize:** The `resize` subresource allows container resources (`spec.containers[*].resources`) to be updated.
253+
See [Resize Container Resources](#resize-container-resources) for more details.
254+
- **Ephemeral Containers:** The `ephemeralContainers` subresource allows
255+
{{< glossary_tooltip text="ephemeral containers" term_id="ephemeral-container" >}}
256+
to be added to a Pod.
257+
See [Ephemeral Containers](/docs/concepts/workloads/pods/ephemeral-containers/) for more details.
258+
- **Status:** The `status` subresource allows the pod status to be updated.
259+
This is typically only used by the Kubelet and other system controllers.
260+
- **Binding:** The `binding` subresource allows setting the pod's `spec.nodeName` via a `Binding` request.
261+
This is typically only used by the {{< glossary_tooltip text="scheduler" term_id="kube-scheduler" >}}.
262+
248263
## Resource sharing and communication
249264

250265
Pods enable data sharing and communication among their constituent
@@ -325,7 +340,8 @@ using the kubelet to supervise the individual [control plane components](/docs/c
325340
The kubelet automatically tries to create a {{< glossary_tooltip text="mirror Pod" term_id="mirror-pod" >}}
326341
on the Kubernetes API server for each static Pod.
327342
This means that the Pods running on a node are visible on the API server,
328-
but cannot be controlled from there. See the guide [Create static Pods](/docs/tasks/configure-pod-container/static-pod) for more information.
343+
but cannot be controlled from there. See the guide [Create static Pods](/docs/tasks/configure-pod-container/static-pod)
344+
for more information.
329345

330346
{{< note >}}
331347
The `spec` of a static Pod cannot refer to other API objects
@@ -387,7 +403,8 @@ shut down.
387403

388404
## Container probes
389405

390-
A _probe_ is a diagnostic performed periodically by the kubelet on a container. To perform a diagnostic, the kubelet can invoke different actions:
406+
A _probe_ is a diagnostic performed periodically by the kubelet on a container.
407+
To perform a diagnostic, the kubelet can invoke different actions:
391408

392409
- `ExecAction` (performed with the help of the container runtime)
393410
- `TCPSocketAction` (checked directly by the kubelet)
@@ -401,14 +418,18 @@ in the Pod Lifecycle documentation.
401418
* Learn about the [lifecycle of a Pod](/docs/concepts/workloads/pods/pod-lifecycle/).
402419
* Learn about [RuntimeClass](/docs/concepts/containers/runtime-class/) and how you can use it to
403420
configure different Pods with different container runtime configurations.
404-
* Read about [PodDisruptionBudget](/docs/concepts/workloads/pods/disruptions/) and how you can use it to manage application availability during disruptions.
421+
* Read about [PodDisruptionBudget](/docs/concepts/workloads/pods/disruptions/)
422+
and how you can use it to manage application availability during disruptions.
405423
* Pod is a top-level resource in the Kubernetes REST API.
406424
The {{< api-reference page="workload-resources/pod-v1" >}}
407425
object definition describes the object in detail.
408426
* [The Distributed System Toolkit: Patterns for Composite Containers](/blog/2015/06/the-distributed-system-toolkit-patterns/) explains common layouts for Pods with more than one container.
409427
* Read about [Pod topology spread constraints](/docs/concepts/scheduling-eviction/topology-spread-constraints/)
410428

411-
To understand the context for why Kubernetes wraps a common Pod API in other resources (such as {{< glossary_tooltip text="StatefulSets" term_id="statefulset" >}} or {{< glossary_tooltip text="Deployments" term_id="deployment" >}}), you can read about the prior art, including:
429+
To understand the context for why Kubernetes wraps a common Pod API in other resources
430+
(such as {{< glossary_tooltip text="StatefulSets" term_id="statefulset" >}} or
431+
{{< glossary_tooltip text="Deployments" term_id="deployment" >}}),
432+
you can read about the prior art, including:
412433

413434
* [Aurora](https://aurora.apache.org/documentation/latest/reference/configuration/#job-schema)
414435
* [Borg](https://research.google/pubs/large-scale-cluster-management-at-google-with-borg/)

‎content/en/docs/concepts/workloads/pods/downward-api.md

+9
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,15 @@ These container-level fields allow you to provide information about
9999
[requests and limits](/docs/concepts/configuration/manage-resources-containers/#requests-and-limits)
100100
for resources such as CPU and memory.
101101

102+
{{< note >}}
103+
{{< feature-state feature_gate_name="InPlacePodVerticalScaling" >}}
104+
Container CPU and memory resources can be resized while the container is running.
105+
If this happens, a downward API volume will be updated,
106+
but environment variables will not be updated unless the container restarts.
107+
See [Resize CPU and Memory Resources assigned to Containers](/docs/tasks/configure-pod-container/resize-container-resources/)
108+
for more details.
109+
{{< /note >}}
110+
102111

103112
`resource: limits.cpu`
104113
: A container's CPU limit

‎content/en/docs/reference/command-line-tools-reference/feature-gates/InPlacePodVerticalScaling.md

+4
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,9 @@ stages:
99
- stage: alpha
1010
defaultValue: false
1111
fromVersion: "1.27"
12+
toVersion: "1.32"
13+
- stage: beta
14+
defaultValue: true
15+
fromVersion: "1.33"
1216
---
1317
Enables in-place Pod vertical scaling.

‎content/en/docs/reference/node/kubelet-files.md

+20-10
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,16 @@ On Linux nodes, the kubelet also relies on reading cgroups and various system fi
2727
On Windows nodes, the kubelet collects metrics via a different mechanism that does not rely on
2828
paths.
2929

30-
There are also a few other files that are used by the kubelet as well as kubelet communicates using local Unix-domain sockets. Some are sockets that the
30+
There are also a few other files that are used by the kubelet as well,
31+
as kubelet communicates using local Unix-domain sockets. Some are sockets that the
3132
kubelet listens on, and for other sockets the kubelet discovers them and then connects
3233
as a client.
3334

3435
{{< note >}}
3536

3637
This page lists paths as Linux paths, which map to the Windows paths by adding a root disk
37-
`C:\` in place of `/` (unless specified otherwise). For example, `/var/lib/kubelet/device-plugins` maps to `C:\var\lib\kubelet\device-plugins`.
38+
`C:\` in place of `/` (unless specified otherwise).
39+
For example, `/var/lib/kubelet/device-plugins` maps to `C:\var\lib\kubelet\device-plugins`.
3840

3941
{{< /note >}}
4042

@@ -85,18 +87,25 @@ Names of files:
8587
### Checkpoint file for device manager {#device-manager-state}
8688

8789
Device manager creates checkpoints in the same directory with socket files: `/var/lib/kubelet/device-plugins/`.
88-
The name of a checkpoint file is `kubelet_internal_checkpoint` for [Device Manager](/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/#device-plugin-integration-with-the-topology-manager)
90+
The name of a checkpoint file is `kubelet_internal_checkpoint` for
91+
[Device Manager](/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/#device-plugin-integration-with-the-topology-manager)
8992

90-
### Pod status checkpoint storage {#pod-status-manager-state}
93+
### Pod resource checkpoints
9194

9295
{{< feature-state feature_gate_name="InPlacePodVerticalScaling" >}}
9396

94-
If your cluster has
95-
[in-place Pod vertical scaling](/docs/concepts/workloads/autoscaling/#in-place-resizing)
96-
enabled ([feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
97-
name `InPlacePodVerticalScaling`), then the kubelet stores a local record of allocated Pod resources.
97+
If a node has enabled the `InPlacePodVerticalScaling`[feature gate](/docs/reference/command-line-tools-reference/feature-gates/),
98+
the kubelet stores a local record of _allocated_ and _actuated_ Pod resources.
99+
See [Resize CPU and Memory Resources assigned to Containers](/docs/tasks/configure-pod-container/resize-container-resources/)
100+
for more details on how these records are used.
98101

99-
The file name is `pod_status_manager_state` within the kubelet base directory
102+
Names of files:
103+
104+
- `allocated_pods_state` records the resources allocated to each pod running on the node
105+
- `actuated_pods_state` records the resources that have been accepted by the runtime
106+
for each pod pod running on the node
107+
108+
The files are located within the kubelet base directory
100109
(`/var/lib/kubelet` by default on Linux; configurable using `--root-dir`).
101110

102111
### Container runtime
@@ -131,7 +140,8 @@ device manager, or storage plugins, and then attempts to connect
131140
to these sockets. The directory that the kubelet looks in is `plugins_registry` within the kubelet base
132141
directory, so on a typical Linux node this means `/var/lib/kubelet/plugins_registry`.
133142

134-
Note, for the device plugins there are two alternative registration mechanisms. Only one should be used for a given plugin.
143+
Note, for the device plugins there are two alternative registration mechanisms
144+
Only one should be used for a given plugin.
135145

136146
The types of plugins that can place socket files into that directory are:
137147

‎content/en/docs/tasks/configure-pod-container/assign-cpu-resource.md

+2
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ kubectl delete namespace cpu-example
261261

262262
* [Configure Quality of Service for Pods](/docs/tasks/configure-pod-container/quality-service-pod/)
263263

264+
* [Resize CPU and Memory Resources assigned to Containers](/docs/tasks/configure-pod-container/resize-container-resources/)
265+
264266
### For cluster administrators
265267

266268
* [Configure Default Memory Requests and Limits for a Namespace](/docs/tasks/administer-cluster/manage-resources/memory-default-namespace/)

‎content/en/docs/tasks/configure-pod-container/assign-memory-resource.md

+2
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,8 @@ kubectl delete namespace mem-example
344344

345345
* [Configure Quality of Service for Pods](/docs/tasks/configure-pod-container/quality-service-pod/)
346346

347+
* [Resize CPU and Memory Resources assigned to Containers](/docs/tasks/configure-pod-container/resize-container-resources/)
348+
347349
### For cluster administrators
348350

349351
* [Configure Default Memory Requests and Limits for a Namespace](/docs/tasks/administer-cluster/manage-resources/memory-default-namespace/)

0 commit comments

Comments
 (0)