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(charts): Update helm chart to support password from secret #799

Merged
merged 6 commits into from
Feb 17, 2023
Merged

Conversation

ashotland
Copy link
Contributor

Using next release added capability of setting dragonfly password with the
DFLY_PASSWORD environment variable

Elaborate test

Signed-off-by: ashotland <[email protected]>
Using recently added capability of setting dragonfly passowrd with the
DFLY_PASSWORD environment variable

Signed-off-by: ashotland <[email protected]>
@ashotland ashotland requested a review from tamcore February 14, 2023 12:32
@ashotland
Copy link
Contributor Author

Hi @tamcore - first helm change for me, so I hope this makes sense.
Hope you can review, appreciate any comments.

@tamcore
Copy link
Contributor

tamcore commented Feb 15, 2023

Hi @ashotland,

generally, seems ok :) But, for something like that, usually the term you'd be looking for is existingSecret. And missing some values for it in the ci/ subfolder.

So I'd make the following proposal:

  • rename secretName and secretKey to existingSecret.name/.key
    • for the case where the user will pre-provision the secret
  • add a key password
    • which would create the Secret and mount it appropriately for the user
    • (This would target users like myself, who have credentials like that SOPS encrypted directly next to the primary values.yaml used for the deployment.)

But I'm gonna leave that up to you :)

@ashotland
Copy link
Contributor Author

Thanks @tamcore for the comments.

I'll apply the suggested rename and followup with secret creation in a later PR.

@ashotland ashotland force-pushed the k8s branch 2 times, most recently from 10a9492 to ed28177 Compare February 16, 2023 12:34
@tamcore
Copy link
Contributor

tamcore commented Feb 16, 2023

I suggest adding

extraObjects:
- apiVersion: v1
  kind: Secret
  metadata:
    name: dfly-password
  stringData:
    password: foobar

to ci/passwordsecret-values.yaml. Then you can properly reference the Secret dfly-password and the key password, and the check should no longer fail :)

@ashotland ashotland force-pushed the k8s branch 3 times, most recently from 62af8a1 to 262ec59 Compare February 16, 2023 16:05
Signed-off-by: ashotland <[email protected]>
@ashotland
Copy link
Contributor Author

Thanks @tamcore :)

Copy link
Contributor

@tamcore tamcore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

If you'd want, you could now be lazy and just make it

    {{- with .Values.passwordFromSecret.existingSecret }}
      - name: DFLY_PASSWORD
        valueFrom:
          secretKeyRef:
            {{- toYaml . | nindent 12 }}
    {{- end }}

and default passwordFromSecret to {} while having name and key commented out. Then the enabled flag wouldn't even be needed. But there's no true right or wrong :)

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

Successfully merging this pull request may close these issues.

3 participants