Warning
You are currently viewing v2.20 of the documentation and it is not the latest. For the most recent documentation, kindly click here.
File path
You can read authentication parameters from files mounted in the KEDA operator pod using the filePath option. This feature requires the KEDA operator to be configured with a root path for file access.
The filePath feature has important security constraints:
--filepath-auth-root-path to define the allowed directoryfilePath in ClusterTriggerAuthentication is treated as a relative path under the configured root pathThe KEDA operator requires a command-line argument to enable file-based authentication:
--filepath-auth-root-path=/path/to/allowed/files
This path should point to a directory where credential files are mounted. The operator will only read files from within this directory.
First, ensure the KEDA operator has the root path configured. Then create a ClusterTriggerAuthentication referencing files:
apiVersion: keda.sh/v1alpha1
kind: ClusterTriggerAuthentication
metadata:
name: file-based-auth
spec:
filePath:
- parameter: apiKey # Required - Defined by the scale trigger
path: credentials/api-key # Required - Path relative to filepath-auth-root-path
Assumptions:
--filepath-auth-root-path configured for the KEDA operator{filepath-auth-root-path}/credentials/api-keycredentials/api-key.txt if the file is named api-key.txt)