Skip to content

Commit b39e01b

Browse files
Tim BannisterNiranjan Darshann
Tim Bannister
and
Niranjan Darshann
committed
Add concept page about cluster autoscaling
Co-Authored-By: Niranjan Darshann
1 parent 11fc2c8 commit b39e01b

File tree

8 files changed

+131
-22
lines changed

8 files changed

+131
-22
lines changed

content/en/docs/concepts/architecture/nodes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,8 @@ Learn more about the following:
578578
* [API definition for Node](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#node-v1-core).
579579
* [Node](https://git.k8s.io/design-proposals-archive/architecture/architecture.md#the-kubernetes-node)
580580
section of the architecture design document.
581+
* [Cluster autoscaling](/docs/concepts/cluster-administration/cluster-autoscaling/) to
582+
manage the number and size of nodes in your cluster.
581583
* [Taints and Tolerations](/docs/concepts/scheduling-eviction/taint-and-toleration/).
582584
* [Node Resource Managers](/docs/concepts/policy/node-resource-managers/).
583585
* [Resource Management for Windows nodes](/docs/concepts/configuration/windows-resource-management/).

content/en/docs/concepts/cluster-administration/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Before choosing a guide, here are some considerations:
5252
## Managing a cluster
5353

5454
* Learn how to [manage nodes](/docs/concepts/architecture/nodes/).
55+
* Read about [cluster autoscaling](/docs/concepts/cluster-administration/cluster-autoscaling/).
5556

5657
* Learn how to set up and manage the [resource quota](/docs/concepts/policy/resource-quotas/) for shared clusters.
5758

content/en/docs/concepts/cluster-administration/addons.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Installing Addons
33
content_type: concept
4-
weight: 120
4+
weight: 150
55
---
66

77
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
---
2+
title: Cluster Autoscaling
3+
linkTitle: Cluster Autoscaling
4+
description: >-
5+
Automatically manage the nodes in your cluster to adapt to demand.
6+
content_type: concept
7+
weight: 120
8+
---
9+
10+
11+
12+
Kubernetes requires {{< glossary_tooltip text="nodes" term_id="node" >}} in your cluster to
13+
run {{< glossary_tooltip text="pods" term_id="pod" >}}. This means providing capacity for
14+
the workload Pods and for Kubernetes itself.
15+
16+
You can adjust the amount of resources available in your cluster automatically:
17+
_node autoscaling_. You can either change the number of nodes, or change the capacity
18+
that nodes provide. The first approach is referred to as _horizontal scaling_, while the
19+
second is referred to as _vertical scaling_.
20+
21+
Kubernetes can even provide multidimensional automatic scaling for nodes.
22+
23+
24+
25+
## Manual node management
26+
27+
You can manually manage node-level capacity, where you configure a fixed amount of nodes;
28+
you can use this approach even if the provisioning (the process to set up, manage, and
29+
decommission) for these nodes is automated.
30+
31+
This page is about taking the next step, and automating management of the amount of
32+
node capacity (CPU, memory, and other node resources) available in your cluster.
33+
34+
## Automatic horizontal scaling {#autoscaling-horizontal}
35+
36+
### Cluster Autoscaler
37+
38+
You can use the [Cluster Autoscaler](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler) to manage the scale of your nodes automatically.
39+
The cluster autoscaler can integrate with a cloud provider, or with Kubernetes'
40+
[cluster API](https://github.com/kubernetes/autoscaler/blob/c6b754c359a8563050933a590f9a5dece823c836/cluster-autoscaler/cloudprovider/clusterapi/README.md),
41+
to achieve the actual node management that's needed.
42+
43+
The cluster autoscaler adds nodes when there are unschedulable Pods, and
44+
removes nodes when those nodes are empty.
45+
46+
#### Cloud provider integrations {#cluster-autoscaler-providers}
47+
48+
The [README](https://github.com/kubernetes/autoscaler/tree/c6b754c359a8563050933a590f9a5dece823c836/cluster-autoscaler#readme)
49+
for the cluster autoscaler lists some of the cloud provider integrations
50+
that are available.
51+
52+
## Cost-aware multidimensional scaling {#autoscaling-multi-dimension}
53+
54+
### Karpenter {#autoscaler-karpenter}
55+
56+
[Karpenter](https://karpenter.sh/) supports direct node management, via
57+
plugins that integrate with specific cloud providers, and can manage nodes
58+
for you whilst optimizing for overall cost.
59+
60+
> Karpenter automatically launches just the right compute resources to
61+
> handle your cluster's applications. It is designed to let you take
62+
> full advantage of the cloud with fast and simple compute provisioning
63+
> for Kubernetes clusters.
64+
65+
The Karpenter tool is designed to integrate with a cloud provider that
66+
provides API-driven server management, and where the price information for
67+
available servers is also available via a web API.
68+
69+
For example, if you start some more Pods in your cluster, the Karpenter
70+
tool might buy a new node that is larger than one of the nodes you are
71+
already using, and then shut down an existing node once the new node
72+
is in service.
73+
74+
#### Cloud provider integrations {#karpenter-providers}
75+
76+
{{% thirdparty-content vendor="true" %}}
77+
78+
There are integrations available between Karpenter's core and the following
79+
cloud providers:
80+
81+
- [Amazon Web Services](https://github.com/aws/karpenter-provider-aws)
82+
- [Azure](https://github.com/Azure/karpenter-provider-azure)
83+
84+
85+
## Related components
86+
87+
### Descheduler
88+
89+
The [descheduler](https://github.com/kubernetes-sigs/descheduler) can help you
90+
consolidate Pods onto a smaller number of nodes, to help with automatic scale down
91+
when the cluster has space capacity.
92+
93+
### Sizing a workload based on cluster size
94+
95+
#### Cluster proportional autoscaler
96+
97+
For workloads that need to be scaled based on the size of the cluster (for example
98+
`cluster-dns` or other system components), you can use the
99+
[_Cluster Proportional Autoscaler_](https://github.com/kubernetes-sigs/cluster-proportional-autoscaler).<br />
100+
101+
The Cluster Proportional Autoscaler watches the number of schedulable nodes
102+
and cores, and scales the number of replicas of the target workload accordingly.
103+
104+
#### Cluster proportional vertical autoscaler
105+
106+
If the number of replicas should stay the same, you can scale your workloads vertically according to the cluster size using
107+
the [_Cluster Proportional Vertical Autoscaler_](https://github.com/kubernetes-sigs/cluster-proportional-vertical-autoscaler).
108+
This project is in **beta** and can be found on GitHub.
109+
110+
While the Cluster Proportional Autoscaler scales the number of replicas of a workload, the Cluster Proportional Vertical Autoscaler
111+
adjusts the resource requests for a workload (for example a Deployment or DaemonSet) based on the number of nodes and/or cores
112+
in the cluster.
113+
114+
115+
## {{% heading "whatsnext" %}}
116+
117+
- Read about [workload-level autoscaling](/docs/concepts/workloads/autoscaling/)

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,8 @@ its [`Cron` scaler](https://keda.sh/docs/2.13/scalers/cron/). The `Cron` scaler
129129
If scaling workloads isn't enough to meet your needs, you can also scale your cluster infrastructure itself.
130130

131131
Scaling the cluster infrastructure normally means adding or removing {{< glossary_tooltip text="nodes" term_id="node" >}}.
132-
This can be done using one of two available autoscalers:
133-
134-
- [**Cluster Autoscaler**](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler)
135-
- [**Karpenter**](https://github.com/kubernetes-sigs/karpenter?tab=readme-ov-file)
136-
137-
Both scalers work by watching for pods marked as _unschedulable_ or _underutilized_ nodes and then adding or
138-
removing nodes as needed.
132+
Read [cluster autoscaling](/docs/concepts/cluster-administration/cluster-autoscaling/)
133+
for more information.
139134

140135
## {{% heading "whatsnext" %}}
141136

@@ -144,3 +139,4 @@ removing nodes as needed.
144139
- [HorizontalPodAutoscaler Walkthrough](/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/)
145140
- [Resize Container Resources In-Place](/docs/tasks/configure-pod-container/resize-container-resources/)
146141
- [Autoscale the DNS Service in a Cluster](/docs/tasks/administer-cluster/dns-horizontal-autoscaling/)
142+
- Learn about [cluster autoscaling](/docs/concepts/cluster-administration/cluster-autoscaling/)

content/en/docs/setup/best-practices/cluster-large.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,7 @@ Learn more about [Vertical Pod Autoscaler](https://github.com/kubernetes/autosca
121121
and how you can use it to scale cluster
122122
components, including cluster-critical addons.
123123

124-
* The [cluster autoscaler](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler#readme)
125-
integrates with a number of cloud providers to help you run the right number of
126-
nodes for the level of resource demand in your cluster.
124+
* Read about [cluster autoscaling](/docs/concepts/cluster-administration/cluster-autoscaling/)
127125

128126
* The [addon resizer](https://github.com/kubernetes/autoscaler/tree/master/addon-resizer#readme)
129127
helps you in resizing the addons automatically as your cluster's scale changes.

content/en/docs/setup/production-environment/_index.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -183,15 +183,9 @@ simply as *nodes*).
183183
to help determine how many nodes you need, based on the number of pods and
184184
containers you need to run. If you are managing nodes yourself, this can mean
185185
purchasing and installing your own physical equipment.
186-
- *Autoscale nodes*: Most cloud providers support
187-
[Cluster Autoscaler](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler#readme)
188-
to replace unhealthy nodes or grow and shrink the number of nodes as demand requires. See the
189-
[Frequently Asked Questions](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md)
190-
for how the autoscaler works and
191-
[Deployment](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler#deployment)
192-
for how it is implemented by different cloud providers. For on-premises, there
193-
are some virtualization platforms that can be scripted to spin up new nodes
194-
based on demand.
186+
- *Autoscale nodes*: Read [Cluster Autoscaling](/docs/concepts/cluster-administration/cluster-autoscaling) to learn about the
187+
tools available to automatically manage your nodes and the capacity they
188+
provide.
195189
- *Set up node health checks*: For important workloads, you want to make sure
196190
that the nodes and pods running on those nodes are healthy. Using the
197191
[Node Problem Detector](/docs/tasks/debug/debug-cluster/monitor-node-health/)

content/en/docs/tasks/run-application/horizontal-pod-autoscale.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,8 +596,9 @@ guidelines, which cover this exact use case.
596596

597597
## {{% heading "whatsnext" %}}
598598

599-
If you configure autoscaling in your cluster, you may also want to consider running a
600-
cluster-level autoscaler such as [Cluster Autoscaler](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler).
599+
If you configure autoscaling in your cluster, you may also want to consider using
600+
[cluster autoscaling](/docs/concepts/cluster-administration/cluster-autoscaling/)
601+
to ensure you are running the right number of nodes.
601602

602603
For more information on HorizontalPodAutoscaler:
603604

0 commit comments

Comments
 (0)