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: | После создания кастомного ресурса 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 |
The following example shows 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” |
The VPA object contains a Pod with the following resources: | В VPA-объекте представлен под с ресурсами: |
yaml resources: limits: cpu: 2 requests: cpu: 1 | yaml resources: limits: cpu: 2 requests: cpu: 1 |
If a container uses all the CPU, and VPA recommends 1.168 CPU for that container, then the ratio between requests and limits will be 100%. In this case, when recreating the Pod, VPA will modify it and set the following resources: | Если контейнер использует весь CPU, и VPA рекомендует этому контейнеру 1.168 CPU, то отношение между запросами и ограничениями будет равно 100%. В этом случае при пересоздании пода VPA модифицирует его и проставит такие ресурсы: |
yaml resources: limits: cpu: 2336m requests: cpu: 1168m | yaml resources: limits: cpu: 2336m requests: cpu: 1168m |
Example No. 2 | Пример 2 |
The following example shows 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” |
The VPA object contains a pod with resources: | В VPA-объекте представлен под с ресурсами: |
yaml resources: limits: cpu: 1 requests: cpu: 750m | yaml resources: limits: cpu: 1 requests: cpu: 750m |
If the request-to-limit ratio is 25% and VPA recommends 1.168 CPU for the container, VPA will change the container resources as follows: | Если отношение запросов и ограничений равно 25%, и VPA рекомендует 1.168 CPU для контейнера, VPA изменит ресурсы контейнера следующим образом: |
yaml resources: limits: cpu: 1557m requests: cpu: 1168m | yaml resources: limits: cpu: 1557m requests: cpu: 1168m |
If you need to limit the maximum number of resources that can be allocated to container constraints, you should use | Если необходимо ограничить максимальное количество ресурсов, которые могут быть выделены для ограничений контейнера, нужно использовать в спецификации объекта VPA |