feat: add BoundServiceAccountToken
trigger authentication type
#6272
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Provide a description of what has been changed
Proposes to add a new
[Cluster]TriggerAuthentication
type calledBoundServiceAccountToken
which allows users to bind a ServiceAccount token to a[Cluster]TriggerAuthentication
object. You can specify it like so:You could already inject Kubernetes service account tokens in triggerAuth refs before by using the
Secret
trigger auth type, but instead of manually embedding it in a long-lived secret, you can now directly specify the service account instead, and it will embed the sa token in an annotation in the triggerAuth object, and the keda-operator will autorotate the token if the expiry is at least 50% stale. You can specify which parameter you pull into the trigger withparameter
, the serviceAccountName in the same namespace as theTriggerAuth
CR, and the expiry as a duration. Note that Kubernetes doesn't allow expirys less than 10m. If you use aClusterTriggerAuth
, note that this works similarly to the Secret trigger auth, and the service account then has to be in theKEDA_CLUSTER_OBJECT_NAMESPACE
namespace.Before I write any tests, I'd like to get feedback first! :)
Checklist
Fixes: #6136