docker-selenium
docker-selenium copied to clipboard
Helm chart: Manage TLS Certificate Externally
User description
Description
The tls-cert-secret.yaml has limited functionality.
It only allows self signed cert generation if ingress is enabled, and tls is disabled. Alternatively, you have to pass the values of the certificate in as non-base64 literals, which causes an issue with the selenium.jks binary.
Motivation and Context
solves #2293
Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist
- [x] I have read the contributing document.
- [x] My change requires a change to the documentation.
- [x] I have updated the documentation accordingly.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
PR Type
Enhancement, Documentation
Description
- Added support for referencing an external TLS secret in the Helm chart.
- Updated the
_nameHelpers.tplto conditionally use the external TLS secret name if provided. - Modified
tls-cert-secret.yamlto skip secret creation when an external TLS secret name is specified. - Updated
values.yamlto include theexternalSecretNamefield in the TLS configuration. - Enhanced README documentation with instructions on how to use an external TLS secret.
Changes walkthrough 📝
| Relevant files | |||||||
|---|---|---|---|---|---|---|---|
| Enhancement |
| ||||||
| Documentation |
|
💡 PR-Agent usage: Comment
/helpon the PR to get a list of all available PR-Agent tools and their descriptions
PR Reviewer Guide 🔍
| ⏱️ Estimated effort to review [1-5] | 2 |
| 🧪 Relevant tests | No |
| 🔒 Security concerns | No |
| ⚡ Key issues to review |
Possible Bug: The PR introduces the ability to use an external TLS secret, but there is no validation to ensure that the external secret exists or is correctly formatted before it is used. This could lead to runtime errors if the secret is missing or misconfigured. |
|
Documentation Clarity: The documentation update in the README.md could be more explicit about the steps required to use an external TLS secret, including necessary commands and expected file formats. |
PR Code Suggestions ✨
| Category | Suggestion | Score |
| Security |
Add a security warning about using self-signed certificates in productionUpdate the documentation to include a warning about the security risks of using charts/selenium-grid/README.md [609]
Suggestion importance[1-10]: 9Why: Adding a security warning is crucial for informing users about the risks of using self-signed certificates in production environments, thus improving the overall security awareness. | 9 |
| Maintainability |
Ensure secrets are only created when TLS is enabled and not managed externallyAdd a condition to check for the existence of the charts/selenium-grid/templates/tls-cert-secret.yaml [1-4]
Suggestion importance[1-10]: 8Why: This suggestion enhances maintainability by adding a condition to check if TLS is enabled and not managed externally before creating the secret, preventing potential conflicts and unnecessary secret creation. | 8 |
Refactor the template to centralize and simplify the truncation and trimming logicRefactor the template to avoid redundancy by defining a helper template for the common charts/selenium-grid/templates/_nameHelpers.tpl [148-150]
Suggestion importance[1-10]: 7Why: The refactoring suggestion improves maintainability by reducing redundancy and centralizing common logic, making the template easier to manage and understand. However, it is not a critical change. | 7 | |
| Best practice |
Improve the clarity of variable names related to TLS configurationConsider using a more descriptive variable name for the Helm template that generates the charts/selenium-grid/templates/_nameHelpers.tpl [147-151]
Suggestion importance[1-10]: 6Why: The suggestion improves the clarity of the variable name, making it more descriptive and specific to TLS configuration. However, it is a minor improvement and not crucial for functionality. | 6 |
Thanks for your feedback and initial contribution. I believe PR #2306 is able to do needful for the requirement. If have time you can walk through the details. I am closing this PR.