SSH Key K8s Secret from AWS Secrets Manager

48 views
Skip to first unread message

Mark deJong

unread,
Sep 30, 2022, 1:06:41 PM9/30/22
to kubernetes-secrets-store-csi-driver
Hello… I have an ssh key stored in AWS secrets manager.  I want to take that key and store it as a K8s secret. The key is stored as plaintext so there is no key reference. It mounts fine inside the pod but when I try to create a secret there is no key/value pair to reference thus getting the following error:

"failed to get data in spc for secret" err="key in secretObjects.data is empty" spc="argocd/builduser-ssh-key" pod="argocd/argo-cd-argocd-server-85f98c9bdd-rvv96" secret="argocd/builduser-ssh-key" spcps="argocd/argo-cd-argocd-server-85f98c9bdd-rvv96-argocd-builduser-ssh-key"

I have also base64 encoded the key but the secrets driver base64 encodes the base64 encoded string so that doesn’t seem to be a solution. Any thoughts on how to overcome this issue? Can base64 encoding be disabled via the manifest?

This is my current manifest:

---
apiVersion: secrets-store.csi.x-k8s.io/v1
kind: SecretProviderClass
metadata:
  name: builduser-ssh-key
  namespace: argocd
spec:
  provider: aws
  parameters:
    objects: |
        - objectName: "ino/github/user/builduser/ssk_key"
          objectType: "secretsmanager"
  secretObjects:
    - secretName: builduser-ssh-key
      type: Opaque
      data:
        - objectName: "ino/github/user/builduser/ssk_key"
          key:


Thanks! 
Reply all
Reply to author
Forward
0 new messages