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

Feat: Add a convenient way to mount preshared keys from secrets #175

Open
c-thiel opened this issue Dec 13, 2024 · 1 comment
Open

Feat: Add a convenient way to mount preshared keys from secrets #175

c-thiel opened this issue Dec 13, 2024 · 1 comment

Comments

@c-thiel
Copy link

c-thiel commented Dec 13, 2024

Currently preshared keys are hardcoded in values.yaml

@grimly
Copy link

grimly commented Dec 30, 2024

Hello,

Here is an example of your use-case

authn:
  method: preshared

extraEnvVars:
  - name: OPENFGA_AUTHN_PRESHARED_KEYS
    valueFrom:
      secretKeyRef:
        name: your-secret
        key: your-key

Make sure you do not have anything in .Values.authn.preshared.keys.

I also had more constraints regarding this injection as I had to use the Vault provider and the CSI driver, which requires the secret also to be loaded as in a volume. Here the configuration would be a bit more involved but still doable in the chart values :

authn:
  method: preshared

extraEnvVars:
  - name: OPENFGA_AUTHN_PRESHARED_KEYS
    valueFrom:
      secretKeyRef:
        name: your-secret
        key: your-key
extraVolumes:
  - name: your-secret-volume
    csi:
      driver: secrets-store.csi.k8s.io
      readOnly: true
      volumeAttributes:
        secretProviderClass: your-secret-provider-class
extraVolumeMounts:
  - name: your-secret-volume
    mountPath: /your/mount/path
    readOnly: true
extraObjects:
  - apiVersion: secrets-store.csi.x-k8s.io/v1
    kind: SecretProviderClass
    metadata:
      name: your-secret-provider-class
    spec:
      provider: vault
      secretObjects:
        - data:
          - key: your-object-name
            objectName: your-key
          secretName: your-secret
          type: Opaque
      parameters:
        vaultAddress: "https://vault"
        objects: |
          - objectName: your-object-name
            secretPath: "your/secret/path/in/vault"
            secretKey: your-vault-key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants