You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/aks/vertical-pod-autoscaler.md
+80-36Lines changed: 80 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Vertical Pod Autoscaling (preview) in Azure Kubernetes Service (AKS)
3
3
description: Learn how to vertically autoscale your pod on an Azure Kubernetes Service (AKS) cluster.
4
4
services: container-service
5
5
ms.topic: article
6
-
ms.date: 09/22/2022
6
+
ms.date: 09/27/2022
7
7
---
8
8
9
9
# Vertical Pod Autoscaling (preview) in Azure Kubernetes Service (AKS)
@@ -14,7 +14,7 @@ This article provides an overview of Vertical Pod Autoscaler (VPA) (preview) in
14
14
15
15
Vertical Pod Autoscaler provides the following benefits:
16
16
17
-
* It analyzes and adjusts processor and memory resources to *right size* your applications. VPA is not only responsible for scaling up, but also for scaling down based on their resource use over time.
17
+
* It analyzes and adjusts processor and memory resources to *right size* your applications. VPA is not only responsible for scaling up, but also for scaling down based on their resource use over time.
18
18
19
19
* A Pod is evicted if it needs to change its resource requests based on if its scaling mode is set to *auto*
20
20
@@ -29,14 +29,16 @@ Vertical Pod Autoscaler provides the following benefits:
29
29
## Limitations
30
30
31
31
* Vertical Pod autoscaling supports a maximum of 500 `VerticalPodAutoscaler` objects per cluster.
32
-
* With this preview release, you cannot change the `controllerValue` and `updateMode`fields.
32
+
* With this preview release, you cannot change the `controllerValue` and `updateMode`properties. While you can see them from the `managedCluster` object, they are reserved for future use.
33
33
34
34
## Before you begin
35
35
36
-
*You have an existing AKS cluster. If you don't, see [Getting started with Azure Kubernetes Service][get-started-with-aks].
36
+
*Your AKS cluster is running Kubernetes version 1.22 and higher.
37
37
38
38
* The Azure CLI version 2.0.64 or later installed and configured. Run `az --version` to find the version. If you need to install or upgrade, see [Install Azure CLI][install-azure-cli].
39
39
40
+
* The `aks-preview` extension version 0.5.102 or later.
41
+
40
42
*`kubectl` should be connected to the cluster you want to install VPA.
41
43
42
44
## API Object
@@ -50,7 +52,7 @@ The Virtical Pod Autoscaler is an API resource in the Kubernetes autoscaling API
50
52
To install the aks-vpapreview preview feature, run the following command:
51
53
52
54
```azurecli
53
-
az feature register Microsoft.ContainerService/AKS-VPAPreview
55
+
az feature register --namespace Microsoft.ContainerService --name AKS-VPAPreview
54
56
```
55
57
56
58
## Deploy, upgrade, or disable VPA on a cluster
@@ -87,6 +89,15 @@ In this section, you deploy, upgrade, or disable the Vertical Pod Autoscaler on
87
89
kubectl get pods -n kube-system
88
90
```
89
91
92
+
The output of the command includes the following results specific to the VPA pods. The pods should show a *running* status.
The following steps create a deployment with two pods, each running a single container that requests 100 millicores and tries to utilize slightly above 500 millicores. Also created is a VPA config pointing at the deployment. The VPA observes the behavior of the pods, and after about five minutes, they are updated with a higher CPU request.
@@ -110,25 +121,43 @@ The following steps create a deployment with two pods, each running a single con
110
121
The example output resembles the following:
111
122
112
123
```bash
113
-
hamster-c7d89d6db-rglf5 1/1 Running 0 48s
114
-
hamster-c7d89d6db-znvz5 1/1 Running 0 48s
124
+
hamster-78f9dcdd4c-hf7gk 1/1 Running 0 24s
125
+
hamster-78f9dcdd4c-j9mc7 1/1 Running 0 24s
115
126
```
116
127
117
-
1. Use the [kubectl describe][kubectl-describe] command on one of the pods to view its CPU and memory reservation. Replace "example ID" with one of the IDs returned in your output from the previous step.
128
+
1. Use the [kubectl describe][kubectl-describe] command on one of the pods to view its CPU and memory reservation. Replace "exampleID" with one of the pod IDs returned in your output from the previous step.
118
129
119
130
```bash
120
-
kubectl describe pod hamster-<exampleID>
131
+
kubectl describe pod hamster-exampleID
121
132
```
122
133
123
-
The example output resembles the following:
134
+
The example output is a snippet of the information about the cluster:
The pod has 100 millicpu and 50 Mibibytes of memory reserved in this example. For this sample application, the pod needs less than 100 millicpu to run, so there is no CPU capacity available. The pods also reserves much less memory than needed. The Vertical Pod Autoscaler *vpa-recommender* deployment analyzes the pods hosting the hamster application to see if the CPU and memory requirements are appropriate. If adjustments are needed, the vpa-updater relaunches the pods with updated values.
130
159
131
-
1. Wait for the vpa-updater to launch a new hamster pod. This should take a minute or two. You can monitor the pods using the [kubectl get][kubectl-get] command.
160
+
1. Wait for the vpa-updater to launch a new hamster pod. This should take a few minutes. You can monitor the pods using the [kubectl get][kubectl-get] command.
132
161
133
162
```bash
134
163
kubectl get --watch pods -l app=hamster
@@ -140,10 +169,17 @@ The following steps create a deployment with two pods, each running a single con
140
169
kubectl describe pod hamster-<exampleID>
141
170
```
142
171
143
-
The example output resembles the following:
172
+
The example output is a snippet of the information describing the pod:
144
173
145
174
```bash
146
-
175
+
State: Running
176
+
Started: Wed, 28 Sep 2022 15:09:51 -0400
177
+
Ready: True
178
+
Restart Count: 0
179
+
Requests:
180
+
cpu: 587m
181
+
memory: 262144k
182
+
Environment: <none>
147
183
```
148
184
149
185
In the previous output, you can see that the CPU reservation increased to 587 millicpu, which is over five times the original value. The memory increased to 262,144 Kilobytes, which is around 250 Mibibytes, or five times the original value. This pod was under-resourced, and the Vertical Pod Autoscaler corrected the estimate with a much more appropriate value.
@@ -154,10 +190,17 @@ The following steps create a deployment with two pods, each running a single con
154
190
kubectl describe vpa/hamster-vpa
155
191
```
156
192
157
-
The example output resembles the following:
193
+
The example output is a snippet of the information about the resource utilization:
158
194
159
195
```bash
160
-
196
+
State: Running
197
+
Started: Wed, 28 Sep 2022 15:09:51 -0400
198
+
Ready: True
199
+
Restart Count: 0
200
+
Requests:
201
+
cpu: 587m
202
+
memory: 262144k
203
+
Environment: <none>
161
204
```
162
205
163
206
## Set Pod Autoscaler requests automatically
@@ -174,29 +217,30 @@ Vertical Pod autoscaling uses the `VerticalPodAutoscaler` object to automaticall
0 commit comments