0

我正在尝试在 AKS 中部署 KEDA 的 Scaledjob。我收到以下错误。

no matches for kind "ScaledJob" in version "keda.sh/v1alpha1"

我尝试部署的代码来自 KEDA 网站。https://keda.sh/docs/2.0/concepts/scaling-jobs/

apiVersion: keda.sh/v1alpha1
kind: ScaledJob
metadata:
  name: rabbitmq-consumer
  namespace: default
spec:
  jobTargetRef:
    template:
      spec:
        containers:
          - name: rabbitmq-client
            image: tsuyoshiushio/rabbitmq-client:dev3
            imagePullPolicy: Always
            command:
              [
                "receive",
                "amqp://user:PASSWORD@rabbitmq.default.svc.cluster.local:5672",
                "job",
              ]
        restartPolicy: Never
    backoffLimit: 4
  pollingInterval: 10 # Optional. Default: 30 seconds
  maxReplicaCount: 30 # Optional. Default: 100
  successfulJobsHistoryLimit: 3 # Optional. Default: 100. How many completed jobs should be kept.
  failedJobsHistoryLimit: 2 # Optional. Default: 100. How many failed jobs should be kept.
  triggers:
    - type: rabbitmq
      metadata:
        queueName: hello
        host: RabbitMqHost
        queueLength: "5"
4

1 回答 1

1

我卸载了 KEDA 并安装了最新的 helm beta 版本。它开始工作正常。我安装的KEDA是稳定版,需要先检查scaledjobs.keda.sh是否存在。

kubectl apply -f https://github.com/kedacore/keda/releases/download/v2.0.0-beta/keda-2.0.0-beta.yaml

运行命令kubectl get crds,检查 scaledjobs.keda.sh

在此处输入图像描述

于 2020-09-28T09:27:49.840 回答