keda icon indicating copy to clipboard operation
keda copied to clipboard

Allow configMapRef in the Trigger metadata

Open majusmisiak opened this issue 1 year ago • 2 comments

Proposal

Currently in Trigger configuration we have a field authenticationRef that allows to reference secrets that are defined externally.

I would like to be able to do the same thing for the Trigger metadata field.

Use-Case

I am using Kafka scaler will following configuration (I truncated most configuration fields for clarity):

apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: my-app
spec:
  maxReplicaCount: 3
  scaleTargetRef:
    name: my-app
  triggers:
  - type: kafka
    metadata:
      bootstrapServers: kafka.localdomain:9092
      lagThreshold: "10"
    authenticationRef:
      name: my-app
---
apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
  name: my-app
spec:
  secretTargetRef:
  - parameter: username
    name: kafka-auth
    key: KAFKA_JAAS_USER
  - parameter: password
    name:kafka-auth
    key: KAFKA_JAAS_PASSWORD

The Secret ( kafka-auth ) is defined in the cluster environment, it is provisioned independently of the application.

The ScaledObject and TriggerAuthentication are part of the Application lifecycle. They are part of shared deployment template used by the development Teams. The developers can manage it's configuration (for example, change the values of maxReplicaCount or lagThreshold).

However, the Developer typically will not configure metadata.bootstrapServers, since that is related to the environment and closely linked to the authentication parameters.

Also this variable is typically shared (all microservices deployed to the namespace connect to the same bootstrap server).

What I would like to do is put fields like bootstrapServers (or sasl, tls configuration) in the environment and reference it from the ScaledObject as such instead:

  triggers:
  - type: kafka
    metadata:
      bootstrapServers:
        configMapRef:
          - name: kafka-config
            key: bootstrapServers

(or similar)

RIght now, that does not seem possible.

Is this a feature you are interested in implementing yourself?

Maybe

Anything else?

No response

majusmisiak avatar Nov 30 '23 08:11 majusmisiak

This is a good idea, but would need to be available for all scalers and related parameters IMO.

@kedacore/keda-maintainers thoughts?

tomkerkhove avatar Dec 01 '23 09:12 tomkerkhove

Created https://github.com/kedacore/keda/issues/5233 to consolidate proposals

tomkerkhove avatar Dec 01 '23 09:12 tomkerkhove

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 31 '24 00:01 stale[bot]

Isn't this fixed by https://github.com/kedacore/keda/pull/5111?

JorTurFer avatar Jan 31 '24 00:01 JorTurFer

Jup, duplicate of https://github.com/kedacore/keda/issues/4830

tomkerkhove avatar Feb 01 '24 10:02 tomkerkhove