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

HelmRelease Guide: Values Secret generated with Kustomize and SOPS #1165

Merged
merged 1 commit into from
Sep 29, 2022

Conversation

kingdonb
Copy link
Member

One more additional guide for HelmReleases with values that come from a SOPS encrypted secret.

There are a few things to be aware of that make this not quite straightforward extrapolation from the ConfigMapGenerator example, I think this should be good to help more users from struggling. This has come up several times in Slack, we finally had a user who was persistent enough to discover all of the major tripping hazards and help me document them here.

We may want to let this one gather some reviews before it merges, I have tested it before writing, so strictly speaking this doc is not yet "tested" as in shown to work from a reading of the document, but the methods are tested and verified to work.

Thanks to our Slack community for helping us cover all our bases in the docs! 🌮 🎉

@kingdonb
Copy link
Member Author

I spent a couple of extra minutes to figure out what kind of creation_rules in .sops.yaml might permit users to encrypt a values.yaml file which is not a well-formed Kubernetes secret, and came up with something that I've now added in a subsequent commit.

@kingdonb
Copy link
Member Author

kingdonb commented Sep 27, 2022

Credit goes to @jseiser who worked out how to do this with a little bit of help in our Slack channel and Discussions pages 🎉

https://gist.github.com/jseiser/eed3b4ffdd1ff3def604c4c78c989c1f
^ his original version is a bit more concise

@kingdonb
Copy link
Member Author

Squashing for review

@kingdonb kingdonb force-pushed the helmrelease-with-secret-generator branch from 553e1ff to 725ab99 Compare September 27, 2022 22:59
@kingdonb kingdonb marked this pull request as ready for review September 27, 2022 22:59
@kingdonb kingdonb force-pushed the helmrelease-with-secret-generator branch from 725ab99 to fab97cd Compare September 27, 2022 23:00
kingdonb pushed a commit to kingdonb/bootstrap-repo that referenced this pull request Sep 28, 2022
ref: fluxcd/website#1165

Signed-off-by: Kingdon Barrett <[email protected]>
Copy link
Member

@pjbgf pjbgf left a comment

Choose a reason for hiding this comment

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

LGTM

Great job @kingdonb! 🙇

@kingdonb kingdonb force-pushed the helmrelease-with-secret-generator branch from 211e468 to 9c8f91f Compare September 28, 2022 18:33
@kingdonb kingdonb force-pushed the helmrelease-with-secret-generator branch from 14daa1e to 07526bb Compare September 28, 2022 19:39
Addition to the HelmRelease Guide: Values from Secret with SOPS

One more additional guide for HelmReleases with values that come from a
SOPS encrypted secret. There are a few things to be aware of that make
this not quite straightforward extrapolation from the ConfigMapGenerator
example, I think this should be good to help more users from struggling.

* show more complete example of .sops.yaml

It's fine to use a different file name so we don't trigger the rule, but
I don't want to avoid talking about `creation_rules` just because I
don't know, don't want to guess what order they were matching. I looked
it up, the first match is chosen, and `filename_regex` has been removed.

Let's not impute that changing a filename to something other than .yaml
is the only good way to skin the cat, I think people will prefer to
learn and understand how to use their `.sops.yaml` instead of making up
strange names to avoid matching the existing rule.

Co-authored-by: Paulo Gomes <[email protected]>
Signed-off-by: Kingdon Barrett <[email protected]>

Use values.yaml as the input filename

Signed-off-by: Kingdon Barrett <[email protected]>
@kingdonb kingdonb force-pushed the helmrelease-with-secret-generator branch from 07526bb to 8295928 Compare September 29, 2022 13:26
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @kingdonb

@stefanprodan stefanprodan merged commit f82db58 into main Sep 29, 2022
@stefanprodan stefanprodan deleted the helmrelease-with-secret-generator branch September 29, 2022 16:52
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