我有一个Keda缩放作业,配置为在RabbitMQ中每个消息生成一个状态“就绪”的作业。
它的最大副本计数设置为70。
观察到:
这是我的Keda配置:
---
# Reference - https://keda.sh/docs/2.0/concepts/scaling-jobs/
apiVersion: keda.sh/v1alpha1
kind: ScaledJob
metadata:
name: scaledjob-puppeteer
labels:
environment: development
app: puppeteer-display
spec:
jobTargetRef:
parallelism: 1 # [max number of desired pods](https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#controlling-parallelism)
completions: 1 # [desired number of successfully finished pods](https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#controlling-parallelism)
activeDeadlineSeconds: 7200 # (2 hours) Specifies the duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer
backoffLimit: 2 # Specifies the number of retries before marking this job failed. Defaults to 6
template:
spec:
volumes:
...
containers:
...
pollingInterval: 10
successfulJobsHistoryLimit: 0
failedJobsHistoryLimit: 0
maxReplicaCount: 75
triggers:
- type: rabbitmq
metadata:
protocol: amqp
queueName: tasks
mode: QueueLength
value: "1"
authenticationRef:
name: keda-trigger-auth-rabbitmq-conn
---当队列中有>= 1消息时,如何使Keda创建作业?
编辑:在创建新作业之前,它似乎至少要等待一个小时。
发布于 2022-06-02 12:01:13
问题似乎是缺少的scalingStrategy设置。您可以添加以下配置:
scalingStrategy:
strategy: accurate当您使用来自队列的消息而不是锁定消息时,将使用准确的设置。这通常用于其他消息队列中。
作为参考,您可以查看https://keda.sh/docs/2.7/concepts/scaling-jobs/,您可以在详细信息部分找到有关缩放策略的更多信息。
https://stackoverflow.com/questions/69435991
复制相似问题