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

[bitnami/mongodb] Adding tls.pemChainIncluded value to support wider range of TLS certificates #16731

Merged
merged 3 commits into from
May 22, 2023

Conversation

dtrts
Copy link
Contributor

@dtrts dtrts commented May 18, 2023

Description of the change

Adding the option tls.pemChainIncluded to values.

When enabled this treats the tls.crt attribute as a certificate chain, with the assumption that the first certificate is the leaf node, and the remaining certificates are the intermediaries.

The generate-tls-certs init container will then split this file, using the leaf node and tls.key for the /certs/mongodb.pem file and the remaining certificates for the /certs/mongodb-ca-cert file.

Benefits

This will enable users to use a wider range of certificates. Specifically ACME validated certificates from cert-manager which do not return the ca.crt attribute in the secret.

Possible drawbacks

Depending on how mutual TLS is configured, and how the cert manager is configured, the pem chain may not be suitable / or easily constructed in such an order.

It will also perform this file operation on all certificates when supplying multiple for replicasets or hidden nodes.
I feel that is a user is using certificates from different sources for each node then they have bigger problems to worry about!

Applicable issues

Additional information

This is mimicking a change to the Kafa chart #9422

Checklist

  • Chart version bumped in Chart.yaml according to semver. This is not necessary when the changes only affect README.md files.
  • Variables are documented in the values.yaml and added to the README.md using readme-generator-for-helm
  • Title of the pull request follows this pattern [bitnami/<name_of_the_chart>] Descriptive title
  • All commits signed off and in agreement of Developer Certificate of Origin (DCO)

…ill allow secrets which contain certificates to only need the tls.key and tls.crt attributes. The assumption is that the tls.crt attribute contains a certificate chain. The generate-tls-certs initilization container will then split the certificate chain, using the first certificate as the leafnode and use in combination with tls.key for the /certs/mongodb.pem file. The remaining certificates in the chain will be placed in the /certs/mongodb-ca-cert file as the intermediary nodes.

This supports the usage of cert-manager.io as there are cases where the secret returned by this controller do not include the ca.crt file.

Signed-off-by: Douglas Thomson <[email protected]>
@github-actions github-actions bot added the triage Triage is needed label May 18, 2023
@bitnami-bot bitnami-bot requested a review from javsalgar May 18, 2023 10:22
@carrodher carrodher added the verify Execute verification workflow for these changes label May 18, 2023
@github-actions github-actions bot added in-progress and removed triage Triage is needed labels May 18, 2023
@bitnami-bot bitnami-bot removed the request for review from javsalgar May 18, 2023 18:04
@bitnami-bot bitnami-bot requested a review from dgomezleon May 18, 2023 18:04
Copy link
Member

@dgomezleon dgomezleon left a comment

Choose a reason for hiding this comment

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

The changes LGTM. I've just suggested two minor changes.
Thanks for contributing.

bitnami/mongodb/templates/common-scripts-cm.yaml Outdated Show resolved Hide resolved
bitnami/mongodb/values.yaml Outdated Show resolved Hide resolved
Returning original indentation and removing changes out of scope.

Signed-off-by: Douglas Thomson <[email protected]>
@dtrts
Copy link
Contributor Author

dtrts commented May 19, 2023

@dgomezleon - The amendments have been made. Thank you for the review.

@dtrts dtrts requested a review from dgomezleon May 19, 2023 18:36
Copy link
Member

@dgomezleon dgomezleon left a comment

Choose a reason for hiding this comment

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

Thank you @dtrts.

@dgomezleon dgomezleon enabled auto-merge (squash) May 22, 2023 08:52
@dgomezleon dgomezleon merged commit 5c2b7b9 into bitnami:main May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mongodb solved verify Execute verification workflow for these changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants