简体   繁体   中英

Kubernetes secrets and AWS Secrets Manager - put different ARNs into the same file?

I have multiple secrets in AWS Secrets Manager and I would like them to all end up in the same file when mounted in the Kube.netes container. How do I specify the manifest file to do that?

My manifest file looks like the below. I end up with two secrets files called /mnt/credentials-a.json and /mnt/credentials-b.json . How do I combine them both into one file called /mnt/credentials.json ?

apiVersion: secrets-store.csi.x-k8s.io/v1alpha1
kind: SecretProviderClass
metadata:
  name: test-secrets
spec:
  provider: aws
  parameters:
    objects: |
      - objectName: "arn:aws:secretsmanager:us-west-2:111122223333:secret:test1-TYabcD"
        objectAlias: credentials-a.json
      - objectName: "arn:aws:secretsmanager:us-west-2:111122223333:secret:test2-AfabcY"
        objectAlias: credentials-b.json

The brute force solution is to use the "Plaintext" tab in AWS Secrets Manager and put all the secrets in one secret ARN. I don't have an elegant solution, but I am not looking for form, I am looking for function.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM