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

Add secret generation to main helm chart. #292

Merged
merged 15 commits into from
Jun 14, 2023

Conversation

ainmosni
Copy link
Contributor

@ainmosni ainmosni commented May 23, 2023

This creates a generic secret template that can be used to generate
secrets for all services. The secret template takes a dict of the scope,
the name of the secret, and the data to be stored in the secret.

This will be used to prefill any non-predefined secrets that are set in
the secretRefs.

Fixes #50

@ainmosni ainmosni requested review from d7oc, Excds and wkloucek May 23, 2023 10:12
Copy link
Contributor

@d7oc d7oc left a comment

Choose a reason for hiding this comment

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

I think @wkloucek wanted to use Jobs instead of lookup as he was afraid of race conditions with lookup and lookup won't work with helm template.

@ainmosni ainmosni marked this pull request as ready for review May 31, 2023 14:40
@mmattel
Copy link
Contributor

mmattel commented May 31, 2023

This is a very cool feature. My intention is to have that somehow documented/mentioned in the admin docs. Any ideas?

@ainmosni
Copy link
Contributor Author

This is a very cool feature. My intention is to have that somehow documented/mentioned in the admin docs. Any ideas?

@mmattel In theory, all that needs to be documented is that people don't need to add most secrets by default, only when they want to customise certain things. So it's more moving current docs around, and even removing some unneeded examples because they are for existing users.

We can chat about it, but I'll be gone until Tuesday, so if you can wait until then, I'll help.

@mmattel
Copy link
Contributor

mmattel commented May 31, 2023

Tuesday is fine, I am just blocked with other stuff.

Copy link
Contributor

@d7oc d7oc left a comment

Choose a reason for hiding this comment

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

Taking the ownership of externally-defined Secrets and ConfigMaps fails here:

Error: UPGRADE FAILED: rendered manifests contain a resource that already exists. Unable to continue with update: Secret "machine-auth-api-key" in namespace "default" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "owncloud"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "default"
helm.go:84: [debug] Secret "machine-auth-api-key" in namespace "default" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "owncloud"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "default"

Aside this the following places contain secrets which are not handled so far:

Other comments are inline

@ainmosni
Copy link
Contributor Author

ainmosni commented Jun 6, 2023

Taking the ownership of externally-defined Secrets and ConfigMaps fails here:

Error: UPGRADE FAILED: rendered manifests contain a resource that already exists. Unable to continue with update: Secret "machine-auth-api-key" in namespace "default" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "owncloud"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "default"
helm.go:84: [debug] Secret "machine-auth-api-key" in namespace "default" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "owncloud"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "default"

Aside this the following places contain secrets which are not handled so far:

* https://github.com/owncloud/ocis-charts/blob/9f85e54faaf86f628328d3d56497c47035bafb5f/charts/ocis/templates/appprovider/deployment.yaml#L79

* https://github.com/owncloud/ocis-charts/blob/9f85e54faaf86f628328d3d56497c47035bafb5f/charts/ocis/templates/policies/deployment.yaml#L78

* https://github.com/owncloud/ocis-charts/blob/9f85e54faaf86f628328d3d56497c47035bafb5f/charts/ocis/templates/storageusers/deployment.yaml#L97

* https://github.com/owncloud/ocis-charts/blob/9f85e54faaf86f628328d3d56497c47035bafb5f/charts/ocis/templates/storageusers/deployment.yaml#L102

* https://github.com/owncloud/ocis-charts/blob/9f85e54faaf86f628328d3d56497c47035bafb5f/charts/ocis/templates/storageusers/jobs.yaml#L69

* https://github.com/owncloud/ocis-charts/blob/9f85e54faaf86f628328d3d56497c47035bafb5f/charts/ocis/templates/storageusers/jobs.yaml#L74

Other comments are inline

These are all fixed, looking for a way around the first problem you mentioned now.

ainmosni and others added 12 commits June 7, 2023 15:20
This creates a generic secret template that can be used to generate
secrets for all services. The secret template takes a dict of the scope,
the name of the secret, and the data to be stored in the secret.

This will be used to prefill any non-predefined secrets that are set in
the secretRefs.

Fixes #50
This empties the value of adminUserSecretRef, which will signal that
the secret should be generated by the chart. I've also started a template
to be inserted where we used to use the value of adminUserSecretRef.
@ainmosni ainmosni force-pushed the ainmosni/issue/50-make-it-easier-to-set-up-secrets branch from 516ce46 to 3430acb Compare June 7, 2023 13:25
@mmattel
Copy link
Contributor

mmattel commented Jun 7, 2023

@ainmosni Minor text bug in commit Update docs.:

If not filled in, will attempt to to use values in .storageusers.storageBackend.s3.driverConfig.s3ng instead.

to to --> to

@wkloucek wkloucek mentioned this pull request Jun 7, 2023
@mmattel
Copy link
Contributor

mmattel commented Jun 14, 2023

Maybe needs a rebase because merging of 305/306/307/308 yesterday.

@d7oc d7oc self-requested a review June 14, 2023 12:16
Copy link
Contributor

@d7oc d7oc left a comment

Choose a reason for hiding this comment

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

PR is fine for me after discussion. Ownership stuff will be documented.

@mmattel
Copy link
Contributor

mmattel commented Jun 14, 2023

Ownership stuff will be documented.

Pls tell more so docs can address this.

@d7oc
Copy link
Contributor

d7oc commented Jun 14, 2023

Ownership stuff will be documented.

Pls tell more so docs can address this.

My understanding was that the text fro this will be provided from @ainmosni or @wkloucek. If that's not the case I could also jump in here if needed.

@ainmosni ainmosni merged commit 0a4a6f4 into master Jun 14, 2023
@delete-merged-branch delete-merged-branch bot deleted the ainmosni/issue/50-make-it-easier-to-set-up-secrets branch June 14, 2023 12:47
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.

make it easier to set up secrets
4 participants