kedacore / keda

KEDA is a Kubernetes-based Event Driven Autoscaling component. It provides event driven scale for any container running in Kubernetes
https://keda.sh
Apache License 2.0
8.5k stars 1.08k forks source link

Stan Scaler: error message consist 'kafka' scaler mention instead of stan scaler #1781

Closed Ritikaa96 closed 3 years ago

Ritikaa96 commented 3 years ago

Report

While working with stan scaler I deployed this scaledbject:

apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: stan-scaledobject
  namespace: gonuts
spec:
  scaleTargetRef:
    name: gonuts-sub
  triggers:
  - type: stan
    metadata:
      natsServerMonitoringEndpoint: "stan-nats-ss.stan.svc.cluster.local:8222"
      qqueueGroup: "grp1"
      durableName: "ImDurable"
      subject: "Test"
      lagThreshold: "10"

As the queuegroup field name was incorrect, ScaledObject created with False status and HPA not created and this warning shows up:

error parsing kafka metadata: no queue group given.

Checking in the scaler code i found the cause of this fallacious error:

func NewStanScaler(config *ScalerConfig) (Scaler, error) {
    stanMetadata, err := parseStanMetadata(config)
    if err != nil {
        **return nil, fmt.Errorf("error parsing kafka metadata: %s", err)**
    }

    return &stanScaler{
        channelInfo: &monitorChannelInfo{},
        metadata:    stanMetadata,
        httpClient:  kedautil.CreateHTTPClient(config.GlobalHTTPTimeout),
    }, nil
}

Expected Behavior

ScaledObject should show warning :

error parsing stan metadata: no queue group given.

Actual Behavior

ScaledObject is created with this warning shows up:

"error": "error parsing kafka metadata: no queue group given."

Steps to Reproduce the Problem

1.Set-up minikube v1.18.1

  1. Install nats streaming statefulset.
  2. Follow the sample till deploying scaledobject.yaml
  3. Deploy given scaledobject file or edit the sample's file replacing "queueGroup" to "qqueueGroup"
  4. Check SO events by kubectl describe so
  5. Check the logs of keda-operator pod by kubectl logs -n keda

Logs from KEDA operator

Keda Operator show error:

error parsing kafka metadata: no durable name group given

KEDA Version

2.2.0

Kubernetes Version

1.20

Platform

Any

Scaler Details

Stan scaler

Anything else?

No response

Ritikaa96 commented 3 years ago

Hi , @tomkerkhove @ahmelsayed @zroubalik . Please take a look.