我目前正在尝试建立一个GKE集群,并基于自定义度量(GPU消耗量)配置一个HorizontalPodAutoscaler。我有两个节点池,我想根据的平均GPU消耗量(每个 node_pool )进行水平缩放。我已经配置了两个相同的HPA如下:
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: ner
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: ner
minReplicas: 1
maxReplicas: 10
metrics:
- type: External
external:
metric:
name: kubernetes.io|container|accelerator|duty_cycle
target:
type: AverageValue
averageValue: 60在这里,我只替换了scaleTargetRef,但是事实证明,这个度量似乎是在集群级别上聚合的。我已经检查了scaleTargetRef是否定义正确。
是否有一种方法可以通过container_name或node_pool过滤度量?任何其他的建议都会很棒!
发布于 2021-04-12 18:06:33
因此,我认为您正在为您的k8集群寻找度量标准,特别是通过container_name或node_pool。
您可以在HPA对象中使用五种度量类型(自动标度/v2beta2)
k explain HorizontalPodAutoscaler.spec.metrics.type --api-version=autoscaling/v2beta2编辑更新
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: ner
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: ner
minReplicas: 1
maxReplicas: 10
metrics:
- type: ContainerResource
containerResource:
name: gpu
container: your-application-container
target:
type: Utilization
averageUtilization: 60编辑更新
适用于GKP 使用云监控度量的自动标度部署
https://stackoverflow.com/questions/67061750
复制相似问题