Skip to content
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

Generated secret should support arbitrary format. #22

Open
mcavoyk opened this issue Aug 28, 2020 · 1 comment
Open

Generated secret should support arbitrary format. #22

mcavoyk opened this issue Aug 28, 2020 · 1 comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@mcavoyk
Copy link
Collaborator

mcavoyk commented Aug 28, 2020

The idea here is that the fetched secret data could be placed within the context of a larger config which is not a secreet. This would avoid having to place the entire configuration into the secret store.

An example secret:

{
  "data": {
      "serviceBapiKey": "foo-123",
      "serviceCapiKey": "bar-456"
  }
}

Would allow for a secret like:

apiVerson: secret-manager.itscontained.io/v1alpha1
kind: ExternalSecret
metadata:
  name: hello-service-config
  namespace: example-ns
spec:
  storeRef:
    name: vault
  data:
  - secretKey: password
    remoteRef:
      path: teamA/hello-service
      property: serviceBapiKey
  template:
    data:
      config.json: |
      {
        "apiUrl": "http://localhost:12345",
        "apiKey": {{ .data.password | quote }}
      }

Which produces:

apiVersion: v1
kind: Secret
metadata:
  name: hello-service-config
  namespace: example-ns
type: Opaque
data:
  config.json: "ewogICJhcGlVcmwiOiAiaHR0cDovL2xvY2FsaG9zdDoxMjM0NSIsCiAgImFwaUtleSI6ICJmb28tMTIzIgp9"
# config.json: |
# {
#   "apiUrl": "http://localhost:12345"
#   "apiKey": "foo-123"
# }
@mcavoyk
Copy link
Collaborator Author

mcavoyk commented Sep 25, 2020

Based on discussion and feedback this should support a target field with template/templateFrom external-secrets/kubernetes-external-secrets#477

@mcavoyk mcavoyk added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

1 participant