Does anyone have any good ideas on how to use secr...
# troubleshooting
k
Does anyone have any good ideas on how to use secrets within Flink K8s Operator
flinkConfiguration
? I wish to share Datadog api key safely to the configuration. • Using
valueFrom:secretKeyRef
doesnt seem to work, I am guessing since operator doesn't support this? • Modifying flink-config.yaml during startup/entrypoint fails because it is configmap and therefore immutable within pods.
r
where is your
env:
declaration? it should be under
operatorPod:
, can you share the snippet of your
env:
k
I am not modifiying the original Flink Operator at all, trying to work only with FlinkDeployment. Mostly because in the end it will not be under my control.
However I am going with modifying its base flink config ConfigMap for now... It is just not really ideal way 😛
r
You can just add the env config under the
operatorPod:
Example:
Copy code
operatorPod:
  priorityClassName: null
  annotations: {}
  labels: {}
  # The env variables only apply to the operator container in the operator pod
  env:
    - name: AWS_REGION
      value: "us-west-2"
    - name: AWS_ACCESS_KEY_ID
      valueFrom:
        secretKeyRef:
          name: aws-keys
          key: aws_access_key
    - name: AWS_SECRET_ACCESS_KEY
      valueFrom:
        secretKeyRef:
          name: aws-keys
          key: aws_secret_key
you would use
envFrom:
to reference an entire config map, and use
env:
to reference a specific value