How to Reference Secrets from Different Namespaces in KEDA?

0
9
Asked By CuriousCoder42 On

I'm working on an infrastructure setup where KEDA is configured using YAML files. The config I've outlined includes a cluster-wide trigger authentication, allowing access across namespaces, but I ran into an issue. By default, KEDA requires secrets referenced in `secretTargetRef` to be in the same namespace as KEDA itself (commonly deployed as 'keda'). While I create ClusterTriggerAuthentications for different services, I'm not sure how to reference secrets from other namespaces like 'kafka' directly. I've come across the `KEDA_CLUSTER_OBJECT_NAMESPACE` environment variable, but it only accepts a single namespace. Is there a way to effectively manage this?

2 Answers

Answered By TechGuru87 On

One solution could be to use a reflector to replicate the secrets into the desired namespaces. While it might seem a bit heavy-handed, it's a straightforward way to ensure that secrets are accessible where needed. However, if you'd prefer something lighter, secret-sync operators could be a great alternative. They allow for more precise control over which secrets you want to sync without duplicating everything.

DevDude99 -

That makes sense! We ran into a similar situation, and using secret-sync operators worked out better for us due to their flexibility.

CloudNinja23 -

But isn't it possible to just create service accounts with proper RBAC permissions to access those secrets cross-namespace? I found that gave us better control.

Answered By SysAdminWiz On

Have you tried using the ExternalSecrets Operator? It allows you to define a `ClusterExternalSecret` and specify the namespace where you want the secret to be reflected. This could be an easier workaround for your issue!

DataDynamo56 -

I think that could be a good approach! I'll look into setting that up to see if it fits our requirements.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.