Hello,
We try to inject a dynamic aws credentials in our pod.
Here the configuration:
annotations:
vault.hashicorp.com/agent-inject: "true"
vault.hashicorp.com/agent-inject-command-awscreds: source /vault/secrets/awscreds
vault.hashicorp.com/agent-inject-secret-awscreds: aws_ctops/creds/kafkaconnect
vault.hashicorp.com/agent-inject-template-awscreds: |
{{ with secret "aws_ctops/creds/kafkaconnect" -}}
export AWS_ACCESS_KEY_ID={{ .Data.access_key }}
export AWS_SECRET_ACCESS_KEY={{ .Data.secret_key }}
{{- end }}
vault.hashicorp.com/ca-cert: /vault/tls/pathofthecertfile
vault.hashicorp.com/role: kafkaconnect
vault.hashicorp.com/tls-secret: nameOfSecret
So the pod is up and running, the file is present, and the content valid.
But the command seems to not be executed. Or maybe not in the good place.
kubectl -n appnamsespace exec -it kafkaconnect-xxxxxx -c kafka-connect-connectors-creator -- env | grep -i aws
The output is empty… If I check an environment variable set in the ENV section of the deployment, I get the output.
The other thing that let us think its doesn’t work, it that our S3 connector is not working.
I try few things like “. /vault/secrets/awscreds”, “/bin/sh -c . /vault/secrets/awscreds” and other things… without any success for now.
Have you any idea why and how we can do export the variable from the vault injector command ?
Thanks for your help !