azureazure-functionsserverlesskedakeda-scaledjob

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


I am trying to deploy Scaledjob of KEDA in AKS. Am getting the below error.

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

The code, I am trying to deploy is got from the KEDA website. 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"

Solution

  • I uninstalled the KEDA and installed the latest beta version of the helm. It started working fine. The KEDA, I installed was a stable version, you need to check first whether the scaledjobs.keda.sh exists.

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

    Run the command kubectl get crds, to check for scaledjobs.keda.sh

    enter image description here