简体   繁体   English

Kube.netes secrets 和 AWS Secrets Manager - 将不同的 ARN 放入同一个文件中?

[英]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.我在 AWS Secrets Manager 中有多个秘密,我希望它们在挂载到 Kube.netes 容器中时最终都在同一个文件中。 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 .我最终得到两个名为/mnt/credentials-a.json/mnt/credentials-b.json的秘密文件。 How do I combine them both into one file called /mnt/credentials.json ?如何将它们合并到一个名为/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.蛮力解决方案是使用 AWS Secrets Manager 中的“Plaintext”选项卡并将所有机密放入一个机密 ARN 中。 I don't have an elegant solution, but I am not looking for form, I am looking for function.我没有优雅的解决方案,但我不是在寻找形式,我在寻找 function。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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