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

allow uuid being created and managed by kubernetes #73

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

colearendt
Copy link
Contributor

@colearendt colearendt commented May 10, 2022

What this PR does / why we need it:

We utilize Helm's lookup command to store a generated uuid in an "internal" secret in Kubernetes. This allows generating the uuid, making it persistent, and notifying the user (in NOTES.txt) that this auto-generation happened. We also tell the user how to disable the message by making that value persistent in values.

Which issue this PR fixes

Special notes for your reviewer:

Happy to discuss this approach, messaging, etc. We have found similar patterns to strike a decent balance when secrets / inputs must exist outside of the application.

Open question: should we allow dangerRegenerateAutomatedValues?

(will walk through checklist once validated as a decent approach)

TODO: update docs accordingly / remove the uuid generation

Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.

  • Chart Version bumped
  • e2e tests pass
  • Variables are documented in the README.md
  • Chart tgz added to /docs and index updated

We utilize Helm's `lookup` command to store a generated `uuid` in an "internal" secret in Kubernetes. This allows generating the `uuid`, making it persistent, and notifying the user (in `NOTES.txt`) that this auto-generation happened. We also tell the user how to disable the message by making that value persistent in values.

close apache#39
@colearendt colearendt changed the base branch from main to master September 29, 2022 20:43
@colearendt colearendt changed the base branch from master to main September 29, 2022 20:43
Copy link
Member

@willholley willholley left a comment

Choose a reason for hiding this comment

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

It'd be great to get this merged. Looks to go me aside from the new secret which I'm not convinced is warranted.

Comment on lines +23 to +34
apiVersion: v1
kind: Secret
metadata:
name: {{ template "couchdb.fullname" . }}-internal
labels:
app: {{ template "couchdb.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
type: Opaque
data:
uuid: {{- include "couchdb.uuid" . }}
Copy link
Member

Choose a reason for hiding this comment

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

I'm not convinced about adding another secret resource here. The secret values erlangCookie, cookieAuthSecret are similarly internal only. It seems like a good clarification to split internal/external secrets but that could be a separate PR (and likely major version bump).

Copy link
Contributor Author

@colearendt colearendt Jan 9, 2023

Choose a reason for hiding this comment

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

I'm happy to tie this into the existing secret if you want 😄 I was mostly isolating because it is being used a bit differently than the other secret - in a somewhat "idempotent" type of fashion where we look up values from it / etc.

It's also a bit tricky whether you use data: or stringData: because it affects whether we need to base64 encode the value... although - this actually looks like it might be a bug. I'll do some more sanity checking. It may need to be another secret if we want to pass stringData as the verbatim value. Or we can use the existing secret and b64enc the value first.

Your call on preference here!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@willholley Thoughts on the right approach here? Would you prefer me to tie this into the existing secret?

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.

A value for couchdbConfig.couchdb.uuid must be set
2 participants