https://rancher.com/ logo
Title
w

wide-magician-63081

02/21/2023, 3:42 PM
Hello everybody, I'm contacting you because I'm trying to set up Keda and as usual I want to use Fleet to deploy its objects. Keda is installed (still KubeVersion problem but that's not the topic here. I deployed a fleet that contains a helm chart of a project of mine with, among other things, two deployments and 2 ScaledObject. Just like the HPAs, Keda modifies the replicas so I added a diff in fleet and it works fine. On the other hand, ScaledObject objects have an “Activating” status when the trigger is pending. This is a normal status (from what I understand). But Rancher sees it in error on its UI and the bundle is also in error.
NotReady(1) [Bundle ebad]; scaledobject.keda.sh ebad-ma7/ebad-back error] Scaling is not performed because triggers are not active, Resource is Ready; scaledobject.keda.sh ebad-ma7/ebad-back modified {"spec":{"triggers":[{"metadata":{"desiredReplicas":"2","end":"35 14 * * *","start":"29 14 * * *","timezone":"Europe/Paris"},"type":"cron"}]}}; scaledobject.keda.sh ebad-ma7/ebad-front error] Scaling is not performed because triggers are not active, Resource is Ready
Is there a way to ignore this type of status? I think it's related to this issue: https://github.com/rancher/fleet/issues/937
c

careful-piano-35019

02/22/2023, 3:51 PM
Hi Damien. That's clearly interesting, and I am interested in what you might be able to achieve with Keda combined with Fleet.
w

wide-magician-63081

02/22/2023, 4:00 PM
Hi Paul, We use Fleet to deploy our user's applications helm charts. We try to integrate keda for several use cases (run app only from 08:00am to 6:00pm or scale app based on Kafka topics). To do this, we have the "ScaledObject" CR in the helm chart.
i

important-oxygen-86641

02/22/2023, 4:17 PM
Hi Damien, I'm not sure if it is related to https://github.com/rancher/fleet/issues/937 as this is only for jobs. It looks like this problem happens with the CR
ScaledObject
Can you provide an example of an
ScaledObject
that stays in that state, please?
w

wide-magician-63081

02/22/2023, 4:42 PM
Hi, for sure :
apiVersion: <http://keda.sh/v1alpha1|keda.sh/v1alpha1>
kind: ScaledObject
metadata:
  name: ebad-back
spec:
  minReplicaCount: 0
  maxReplicaCount: 2
  scaleTargetRef:
    name: {{ .Values.backend.name }}-backend
  triggers:
    - type: cron
      metadata:
        timezone: Europe/Paris
        start: 29 14 * * *
        end: 35 14 * * *
        desiredReplicas: "2"
👀 1
i

important-oxygen-86641

02/22/2023, 4:59 PM
I installed Keda, then applied this ScaledObject but it looks like I'm missing more things. I'll try to reproduce it tomorrow with the examples from https://github.com/turbaszek/keda-example
👍 1
Hi Damien, I managed to reproduce the issue. The problem is that the ScaledObject resource has the active condition set to false
status:
  conditions:
  - message: ScaledObject is defined correctly and is ready for scaling
    reason: ScaledObjectReady
    status: "True"
    type: Ready
  - message: Scaling is not performed because triggers are not active
    reason: ScalerNotActive
    status: "False"
    type: Active
  - status: Unknown
    type: Fallback
If there is an active condition that is false, the fleet-agent set this BundleDeployment to have an activating state
- apiVersion: <http://keda.sh/v1alpha1|keda.sh/v1alpha1>
    kind: ScaledObject
    name: rabbitmq-consumer
    namespace: default
    summary:
      error: true
      message:
      - Scaling is not performed because triggers are not active
      - Resource is Ready
      state: activating
I don't have much experience with Keda, but if there is any way to set the
ScaledObject
resource to have an Active equals to true it should fix the problem. If not, I would suggest to create an issue since it looks like fleet always mark the Bundle as error is Active is false even if Ready is true. However, that might be the expected behavior for other kubernetes resources. Therefore I'm not sure if this can be changed
🙌 1
w

wide-magician-63081

02/23/2023, 10:19 AM
Hi Raul, Thank you for your analyse. Yes, this is the behaviour of Keda (I have the same behaviour with a Cis ClusterScan which have a failure). So, I'm going to create an issue on Fleet project. Regards
👍 1
c

cool-thailand-26552

02/23/2023, 2:58 PM
@important-oxygen-86641 The problem seems to happen also for CIS Scans that did complete successfully but have a rule that is not satisfied. For example, the scan shown in screenshots should not be in Error because the scan is actually completed, but a couple of rules are not satisfied. Fleet should only consider `Created`equals
true
👍 1
i

important-oxygen-86641

02/23/2023, 3:26 PM
Probably the ClusterScan CR has other conditions not satisfied
c

cool-thailand-26552

02/23/2023, 5:21 PM
There is a screenshot of that above. The possible culprits are
Pending
=
true
or
Alerted
=
false
.
n

nutritious-orange-38459

03/13/2023, 8:19 AM
@wide-magician-63081 Did you find any way to work around this in the mean time?
Link to the corresponding issue: https://github.com/rancher/fleet/issues/1386
w

wide-magician-63081

03/13/2023, 8:48 AM
Hi @nutritious-orange-38459, No I didn't find a work around.