1

i have created a ScaledObject and TriggerAuthentication using Keda, in order to horizontally autoscale my pods based on a RabbitMQ length.

but for some reason, when i try to query my ScaledObjects like this:

kubectl get ScaledObjects -n mynamespace

i am not getting anything. but when i am applying the yaml file which contains all of the information about the ScaledObject, the output is this:

scaledobject.keda.sh/rabbitmq-scaledobject unchanged

i am also able to edit this scaled object using this command:

kubectl edit scaledobject.keda.sh/rabbitmq-scaledobject -n mynamespace

but i am not sure why it is not listed when doing this command:

kubectl get ScaledObjects -n mynamespace

the autoscaler does work, i am just wondering why it is not listed..

Thanks in Advance, Yaniv

  • How about `kubectl get scaledobject.keda.sh/rabbitmq-scaledobject -n mynamespace`? – Todd Holmberg Jan 10 '22 at 21:20
  • @ToddHolmberg this works as well, but not sure why i don't see it as part of the list when trying to do: `kubectl get ScaledObjects -n mynamespace` – Yaniv Akiva Jan 11 '22 at 01:08
  • Installed `keda v2.5.0` on `minikube`, created a `scaledobject` and can see it with `kubectl get scaledobjects` command. What versions of `keda` and `kubectl` are used? – moonkotte Jan 11 '22 at 10:33
  • am also using keda v2.5.0, kubectl version gives me this output: `Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.4", GitCommit:"b695d79d4f967c403a96986f1750a35eb75e75f1", GitTreeState:"clean", BuildDate:"2021-11-17T15:48:33Z", GoVersion:"go1.16.10", Compiler:"gc", Platform:"darwin/amd64"} Server Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.9", GitCommit:"a5e4de7e277a707bd28d448bd75de58b4f1cdc22", GitTreeState:"clean", BuildDate:"2021-11-16T01:09:55Z", GoVersion:"go1.15.14", Compiler:"gc", Platform:"linux/amd64"}` @moonkotte – Yaniv Akiva Jan 12 '22 at 10:23
  • Which kubernetes platform is used? Like minikube or managed in cloud? To try to reproduce it exactly. – moonkotte Jan 17 '22 at 10:04
  • @moonkotte using AKS – Yaniv Akiva Jan 17 '22 at 23:12

1 Answers1

0

This might be a case of having more than one Custom Resource defined with the same kind but a different apiVersion.

For example, these two versions of Keda create the ScaledObject with different apiVersion:

  • 1.4:
apiVersion: keda.k8s.io/v1alpha1
kind: ScaledObject
  • 2.0:
apiVersion: keda.sh/v1alpha1
kind: ScaledObject

So when you run kubectl get ScaledObjects -n mynamespace, it might be defaulting to the one you are not using.

Cassio
  • 1,347
  • 13
  • 15