-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KEDA tries to resolve secrets from restricted namespace #4519
Comments
I think that we should skip the check here if the secrets are restricted to a namespace different from the SO namespace keda/pkg/scaling/resolver/scale_resolvers.go Lines 305 to 317 in c143d42
|
Is it possible to implement your proposal? |
Hey, |
@JorTurFer I quickly looked into this issue, and I'm wondering if it could be sufficient to use
to ignore error when the secret is not found, instead of making code changes. |
Could be (I'm not sure), but it requires changes in how the workload is deployed and KEDA should be able to handle this security requirement internally, not asking for secrets outside the allowed namespaces. IMO the code should be changed at the end |
Report
I have KEDA up and running using
KEDA_RESTRICT_SECRET_ACCESS
environment variable which restricts secret access to only KEDA namespace. I have a rather simple ScaleObject (below) which has a target deployment and scale trigger using prometheus as a source. There is no TriggerAuthentication or any other reference to secrets in ScaledObject.The target deployment (
test-deployment
) has some environment variables from secrets:When I apply the ScaledObject to the cluster it fails to create the HPA resource for ScaledObject because it cannot find the secret what the deployment uses:
However if I allow KEDA to access secrets from all namespaces the ScaledObject and HPA are created succesfully and everything works fine.
Expected Behavior
KEDA should not need to access secrets from the namespace where the scale target is located if there is no reference to a secret in the ScaledObject or TriggerAuthentication is not used.
Actual Behavior
KEDA tries to list/watch/get secrets from the scale target namespace even though usage of secret(s) is not required from ScaledObject.
Steps to Reproduce the Problem
Logs from KEDA operator
KEDA Version
2.10.0
Kubernetes Version
1.24
Platform
Google Cloud
Scaler Details
Prometheus
Anything else?
No response
The text was updated successfully, but these errors were encountered: