keda icon indicating copy to clipboard operation
keda copied to clipboard

Keda scale error with optional secrets or configmaps

Open coolibre opened this issue 1 year ago • 0 comments

Report

Keda operator reports

"error": "error resolving secrets for ScaleTarget: error resolving secret name &SecretKeySelector{LocalObjectReference:LocalObjectReference{Name:aws-timestream,},Key:AWS_TIMESTREAM_SECRETKEY,Optional:*true,

when optional secret is defined in scaledjob.yaml but the secret is not provided in the currently created kubernetes environment because its optional.

             - name: AWS_TIMESTREAM_SECRETKEY
                valueFrom:
                  secretKeyRef:
                    name: aws-timestream
                    key: AWS_TIMESTREAM_SECRETKEY
                    optional: true

Expected Behavior

The scaler should ignore the missing secret or configmap and scale a job.

Actual Behavior

The scaler searches for the optional secret or configmap and raises an error

Steps to Reproduce the Problem

  1. Create a Scaled Job with optional configmapKeyRef or secretKeyRef
  2. Trigger Keda scaler with message

Logs from KEDA operator

"error": "error resolving secrets for ScaleTarget: error resolving secret name &SecretKeySelector{LocalObjectReference:LocalObjectReference{Name:aws-timestream,},Key:AWS_TIMESTREAM_SECRETKEY,Optional:*true,

KEDA Version

2.8.0

Kubernetes Version

1.21

Platform

Any

Scaler Details

Redis Lists

Anything else?

No response

coolibre avatar Aug 19 '22 10:08 coolibre