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

Retrieve secret based on labels #384

Open
ap0phi5 opened this issue Feb 21, 2024 · 0 comments
Open

Retrieve secret based on labels #384

ap0phi5 opened this issue Feb 21, 2024 · 0 comments
Labels

Comments

@ap0phi5
Copy link

ap0phi5 commented Feb 21, 2024

TL;DR

If the consumer does not know the secret Name, the consumer should be able to select a secret based on key-value attributes. Users otherwise have to resort to establishing some sort of naming convention, which can be somewhat fragile.

Example:

image

Design

Proposal
Since the resourceName is not known, we need to instead include a format for querying labels.

resourceName: "projects/$PROJECT_ID/secrets/??????/versions/latest"

Solution

apiVersion: secrets-store.csi.x-k8s.io/v1
kind: SecretProviderClass
metadata:
  name: app-secrets
spec:
  provider: gcp
  parameters:
    secrets: |
      - projectId: "$PROJECT_ID"
        versions: "latest"
        labels: |
          - environment: "dev01"
            name: "test"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant