How do I view the Vertical Pod Autoscaler recommendations? | Как посмотреть рекомендации Vertical Pod Autoscaler? |
You can view the VPA recommendations after the VerticalPodAutoscaler custom resource is created using the following command: | После создания custom resource VerticalPodAutoscaler посмотреть рекомендации VPA можно следующим образом: |
shell kubectl describe vpa my-app-vpa | shell kubectl describe vpa my-app-vpa |
The
| В секции
|
How does Vertical Pod Autoscaler handle limits? | Как Vertical Pod Autoscaler работает с лимитами? |
Example No. 1 | Пример 1 |
Suppose we have a VPA object: | У нас есть VPA-объект: |
yamlapiVersion: autoscaling.k8s.io/v1 kind: VerticalPodAutoscaler metadata: name: test2 spec: targetRef: apiVersion: “apps/v1” kind: Deployment name: test2 updatePolicy: updateMode: “Initial” | yamlapiVersion: autoscaling.k8s.io/v1 kind: VerticalPodAutoscaler metadata: name: test2 spec: targetRef: apiVersion: “apps/v1” kind: Deployment name: test2 updatePolicy: updateMode: “Initial” |
Also, there is a Pod with the following resource configuration: | И есть под с такими ресурсами: |
yaml resources: limits: cpu: 2 requests: cpu: 1 | yaml resources: limits: cpu: 2 requests: cpu: 1 |
If the container consumes, say, 1 CPU and VPA recommendation for this container is 1.168 CPU, the module will calculate the ration between requests and limits. In our case, the ratio equals 100%. Thus, VPA will modify the Pod’s resource configuration when the Pod is recreated: | В данном случае, если контейнер будет потреблять, к примеру, 1 CPU целиком и VPA порекомендует данному контейнеру 1,168 CPU, вычисляется ratio между реквестами и лимитами. В данном случае он будет равен 100%. В этом случае при пересоздании пода VPA модифицирует его и проставит такие ресурсы: |
yaml resources: limits: cpu: 2336m requests: cpu: 1168m | yaml resources: limits: cpu: 2336m requests: cpu: 1168m |
Example No. 2 | Пример 2 |
Suppose we have a VPA object: | У нас есть VPA-объект: |
yamlapiVersion: autoscaling.k8s.io/v1 kind: VerticalPodAutoscaler metadata: name: test2 spec: targetRef: apiVersion: “apps/v1” kind: Deployment name: test2 updatePolicy: updateMode: “Initial” | yamlapiVersion: autoscaling.k8s.io/v1 kind: VerticalPodAutoscaler metadata: name: test2 spec: targetRef: apiVersion: “apps/v1” kind: Deployment name: test2 updatePolicy: updateMode: “Initial” |
Also, there is a Pod with the following resource configuration: | И есть под с такими ресурсами: |
yaml resources: limits: cpu: 1 requests: cpu: 750m | yaml resources: limits: cpu: 1 requests: cpu: 750m |
In our case, the ratio of requests and limits is 25%, and the resource configuration of the container will be as follows (given that VPA recommends 1.168 CPU): | В данном случае соотношение реквестов и лимитов будет равным 25%, и если VPA порекомендует для контейнера 1,168 CPU, то VPA изменит ресурсы контейнера таким образом: |
yaml resources: limits: cpu: 1557m requests: cpu: 1168m | yaml resources: limits: cpu: 1557m requests: cpu: 1168m |
To limit the maximum amount of resources, set the | Если вам необходимо ограничить максимальное количество ресурсов, которое может быть заданно для лимитов контейнера, необходимо использовать в спецификации VPA-объекта |