-
Notifications
You must be signed in to change notification settings - Fork 141
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
Documentation on how to use a secret as an env var #286
Comments
I had same challenges in EKS. I have created pull request, also updated in my repo here https://github.com/vettom/Aws-Eks-SecretsManager |
I have same issue, but i do not create k8s secret object |
let say you have secret in aws with this value :
create SecretProviderClass
then set as env var on your deployment
|
This is an alternative way of configuring than the one provided by @gonewaje Lets say you have secret in aws with this value: {
"username": "user",
"password": "pass"
} Create SecretProviderClass: apiVersion: secrets-store.csi.x-k8s.io/v1
kind: SecretProviderClass
metadata:
name: myspcname
spec:
provider: aws
parameters:
objects: |
- objectName: "<secret ARN / secret name in aws>"
objectType: secretsmanager
jmesPath:
- path: username # json path on your secret aws
objectAlias: "secret-username"
secretObjects:
- secretName: mysecretname
data:
- objectName: secret-username # value get from objectAlias
key: ZZZSECRET_USERNAME # will be the env variable name
type: Opaque Then set as envFrom on your deployment (so all keys are available as env vars): containers:
envFrom:
- secretKeyRef:
name: mysecretname |
Hello. We have a secret in AWS Secrets Manager in JSON format (
{"host":"www.host.com","user":"theuser","pass":"thepass"}
) and we'd like to retrieve each of the fields and inject them as env var to a container, however, the documentation for this use case in the case of AWS provider is missing. I can see some documentation for Azure here but not for AWS. Would it be possible to add it? Thanks in advance.The text was updated successfully, but these errors were encountered: