【发布时间】:2019-09-24 17:45:44
【问题描述】:
我在GCP 中使用Kubernetes。我正在使用上传到 Cloud Monitoring 的队列大小指标来扩展我的 pod。
问题: Kubernetes 在很短的时间间隔内扩展 pod。每次放大之间大约 12-15 秒。我的机器需要大约 30 秒才能启动。我希望放大间隔接近 30。
添加
spec:
minReadySeconds: 30
到部署 yaml 没有工作。
示例 hpa:
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: <NAME>
namespace: <NAMESPACE>
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: <DEPLOYMENT>
minReplicas: <MIN_REPLICAS>
maxReplicas: <MAX_REPLICAS>
metrics:
- type: External
external:
metricName: "custom.googleapis.com|rabbit_mq|<QUEUE>|messages_count"
metricSelector:
matchLabels:
metric.labels.name: <NAMESPACE>
targetValue: <TARGETVALUE>
有没有办法控制这个放大间隔?
【问题讨论】:
标签: kubernetes google-cloud-platform google-kubernetes-engine