Skip to content

Commit 97fd384

Browse files
committed
Describe manual scaling and update page outline
1 parent 0770e97 commit 97fd384

File tree

1 file changed

+70
-17
lines changed

1 file changed

+70
-17
lines changed

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

Lines changed: 70 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,92 @@ weight: 40
88

99
<!-- overview -->
1010

11-
The concept of _Autoscaling_ in Kubernetes refers to the ability to automatically update the available
12-
resources of your cluster. This can be either a replication controller (for example a
13-
{{< glossary_tooltip text="Deployment" term_id="deployment" >}} or
14-
{{< glossary_tooltip text="ReplicaSet" term_id="replica-set" >}}), or the cluster infrastructure
15-
itself (for example the number of {{< glossary_tooltip text="Nodes" term_id="node" >}}).
11+
In Kubernetes, you can _scale_ a workload depending on the current demand of resources.
12+
This allows your cluster to react to changes in resource demand more elastically and efficiently.
1613

17-
Besides the differentiation in _what_ is being scaled, there are also different options for _how_ to scale:
14+
There are manual and automatic ways to scale your workloads, depending on your use case.
1815

19-
- scale the number of available instances (such as Pods or Nodes)
20-
- scale the available resources on existing instances themselves (such as CPU or memory)
16+
<!-- body -->
17+
18+
## Scaling workloads manually
19+
20+
Kubernetes supports _manual scaling_ of workloads, either by changing the number of
21+
{{< glossary_tooltip text="Replicas" term_id="replica">}} of an object that manages a set of
22+
{{< glossary_tooltip text="Pods" term_id="pod" >}} (for example a {{< glossary_tooltip text="Deployment" term_id="deployment" >}}),
23+
or by adjusting the provided resources of each Replica (for example CPU or memory).
24+
25+
### Scaling the number of Replicas of a workload
26+
27+
You can use the `kubectl scale` command to increase or decrease the number of Replicas of a workload:
28+
29+
```shell
30+
kubectl scale deployment <deployment-name> --replicas=<desired-replicas>
31+
```
32+
33+
See also this [example of scaling a Deployment](/docs/concepts/workloads/controllers/deployment/#scaling-a-deployment) in the `Deployment` documentation.
34+
35+
### Resizing workloads in-place
36+
37+
Instead of scaling the number of Replicas of a workload, you can also adjust the provided resources
38+
of each Replica, in-place. You do this by patching the entries in one or both of the following
39+
fields of the `Pod` or [PodTemplate](/docs/concepts/workloads/pods/#pod-templates) you want to resize:
40+
41+
- `spec.containers[*].resources.requests`
42+
- `spec.containers[*].resources.limits`
43+
44+
{{< caution >}}
45+
Resizing a workload in-place **without** restarting the Pods or its Containers requires Kubernetes version 1.27 or later.
46+
{{< /caution >}}
47+
48+
See also this task about [resizing CPU and memory resources](/docs/tasks/configure-pod-container/resize-container-resources) assigned to Containers.
49+
50+
## Scaling workloads automatically
51+
52+
Kubernetes also supports _automatic scaling_ of workloads, which is the focus of this page.
53+
54+
The concept of _Autoscaling_ in Kubernetes refers to the ability to automatically update the workloads of your cluster. This can be either an object that manages a set of Pods (for example a
55+
{{< glossary_tooltip text="Deployment" term_id="deployment" >}} or Pods or PodTemplates themselves.
56+
57+
Depending on _what_ is being scaled, there are also different options for _how_ to scale:
58+
59+
- scale the number of available instances (such as Replicas in a Deployment)
60+
- scale the available resources on existing instances themselves (such as CPU or memory of a {{< glossary_tooltip text="Container" term_id="container" >}} in a Pod)
2161

2262
The first option is referred to as _horizontal scaling_, while the second is referred to as _vertical scaling_.
2363

24-
<!-- body -->
64+
### Scaling workloads horizontally
2565

26-
## Scaling workloads horizontally
66+
In Kubernetes, you can automatically scale a workload horizontally using a _HorizontalPodAutoscaler_ (HPA).
2767

28-
In Kubernetes, you can scale a workload horizontally using a _HorizontalPodAutoscaler_ (HPA).
2968
It is implemented as a Kubernetes API resource and a {{< glossary_tooltip text="controller" term_id="controller" >}}
30-
and periodically adjusts the number of {{< glossary_tooltip text="replicas" term_id="replica" >}}
69+
and periodically adjusts the number of {{< glossary_tooltip text="Replicas" term_id="replica" >}}
3170
in a workload to match observed resource utilization such as CPU or memory usage.
3271

3372
There is a [walkthrough example](/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough) of configuring a HorizontalPodAutoscaler for a Deployment.
3473

35-
## Scaling workloads vertically
74+
### Scaling workloads vertically
75+
76+
_tbd_
77+
78+
### Event driven Autoscaling
79+
80+
_tbd_
81+
82+
### Autoscaling based on cluster size
83+
84+
_tbd_
85+
86+
### Autoscaling based on schedules
87+
88+
_tbd_
3689

37-
_tba_ about VerticalPodAutoscaler
90+
## Scaling cluster infrastructure
3891

39-
##
92+
_tbd_, short summary
4093

41-
## Advanced Scenarios
94+
## Third-party Autoscalers
4295

43-
_tba_ about Cluster Proportional Autoscaler, KEDA, and KNative Autoscaler
96+
_tbd_, short summary of KEDA and KNative autoscalers
4497

4598
## {{% heading "whatsnext" %}}
4699

0 commit comments

Comments
 (0)