【发布时间】:2019-12-11 07:52:59
【问题描述】:
我正在尝试使用自动缩放场景(目前使用 microk8s 单节点个人集群)。
基本的 CPU 缩放工作正常。
对于更复杂的场景,我正在尝试遵循https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/#autoscaling-on-multiple-metrics-and-custom-metrics 的指南,但我无法弄清楚可能的 pod 指标/对象指标是如何/在何处定义/记录的。例如,.. "packets-per-second" 记录在哪里。
我可以通过 kubectl 导航或手动执行 REST API,但必须有更好的方法。
谢谢
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: php-apache
namespace: default
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: php-apache
minReplicas: 1
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: AverageUtilization
averageUtilization: 50
- type: Pods
pods:
metric:
name: packets-per-second ====> where is this name defined/documented ?
targetAverageValue: 1k
- type: Object
object:
metric:
name: requests-per-second ====> where is this name defined/documented ?
describedObject:
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
name: main-route
target:
kind: Value
value: 10k
【问题讨论】:
-
对于它的价值,这大约是我在 k8s 文档中所能获得的深度,但我仍然无法弄清楚确定监控 kubernetes.io/docs/reference/generated/kubernetes-api/v1.15/… 的可能指标的逻辑。我想一个例子可以帮助我理解。
标签: kubernetes scalability autoscaling kubernetes-pod