passbolt / charts-passbolt

Helm charts to run Passbolt on Kubernetes. No strings attached charts to run the open source password manager for teams!
https://passbolt.com
GNU Affero General Public License v3.0
41 stars 27 forks source link

passbolt-library.gen-certs is non-deterministic, thus creating sync issue with ArgoCD #32

Closed guillaumevillemont closed 4 months ago

guillaumevillemont commented 1 year ago

What's happening

I'm deploying this chart through ArgoCD with sync and self-healing enabled.

Once deployed, Argo keeps complaining about out-of-sync changes and wants to recreate passbolt-sec-tls and passbolt-sec-jwt.


and there is no way to provide an existing secret or set those values manually.

## What I expected
I would like this whole charts to be deterministic, by being able to set those variables myself.
dlen commented 1 year ago

Thanks for the report @guillaumevillemont you are right we should publish the library chart, it was our initial idea but the task went through the cracks.

If I understand it correctly you want the chart deployment to be deterministic without setting the jwtServerPrivate and jwtServerPublic values?

guillaumevillemont commented 1 year ago

you want the chart deployment to be deterministic without setting the jwtServerPrivate and jwtServerPublic values?

That would be ideal and should be the long-term goal here, but I doubt it's easy and quickly fixed.

On the short-term, since I can set jwtServerPrivate|Public this part is not an issue (once I've set them explicitly, the rendered template is determined) But I can not set the tls.crt, tls.key, server.crt, server-key.pem, ca.crt,ca.pem. That's my issue mainly. So at least, exposing those variables from the library to this chart should solve the problem (the same way as jwtServerPrivate|Public)

And I think long-term and short-term fixes are not exclusive, so we can do both :)

dlen commented 1 year ago

Alright so I pushed a fix into https://github.com/passbolt/charts-passbolt/tree/feature/GH_32 here is the diff https://github.com/passbolt/charts-passbolt/compare/main...feature/GH_32

Introducing new values: app.ssl.key, app.ssl.cert and app.ssl.k8sCerts (k8sCerts is not a great choice but I didn't come up with anything better as of now).

These will be injected in /etc/ssl/certificate.key and /etc/ssl/certificate.crt which are used by passbolt nginx config. (which was not the case before so we are fixing a bug at the same time)

As I'm not using argocd would you mind testing in your environment to ensure the fix works for you or if you have any other feedback let us know.

jouve commented 1 year ago

Instead of app.ssl... values, I suggest referencing a Secret by secretName (a secret of type kubernetes.io/tls).

then people can generate their own Secret or use a tool like cert-manager.

kubernetes.io/tls has 3 fields :

dlen commented 1 year ago

Yeah, that sounds good! I guess we can keep the values and add another values option to reference an already-created secret.

jouve commented 1 year ago

an example in bitnami/kibana chart: https://github.com/bitnami/charts/tree/85f0b50e32d81f4720af678ff096ff3d1907472a/bitnami/kibana#kibana-server-tls-configuration :)

dlen commented 11 months ago

Hi, ability to load external secrets for ingresss and passbolt volume mounts has been added (see tls.existingSecret). This should make the chart deterministic along with the JWT workaround.

I will keep this issue open till we solve the JWT one completely that is also related with #33