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 overrides for livenessProbe and readinessProbe actions through helm values #481

Merged
merged 8 commits into from
May 30, 2024

Conversation

ericwyles
Copy link
Contributor

@ericwyles ericwyles commented May 9, 2024

This pull request moves the 'exec' actions from liveness and readiness probes out to the values.yaml so they can be overridden.

The problem this fixes is when deploying the sonarqube using the helm chart but with hardened container images (for security), the hardened images are often minimal and don't contain extra executables like wget, hostname, etc.

This allows us to specify an alternate, simpler probe strategy when deploying to one of these hardened environments, but maintains the current behavior as default.

With the current helm chart, we have to maintain a fork of the chart to change the probes for some environments.

Relates to this discussion: https://community.sonarsource.com/t/helm-chart-probes-issue-with-hardened-container-images-no-wget/114377

This change also has the added benefit of consolidating the probe definitions between the StatefulSet and the Deployment types.


Please ensure your pull request adheres to the following guidelines:

  • explain your motives to contribute this change: what problem you are trying to fix, what improvement you are trying to make
  • Document your Changes in the CHANGELOG.md file of the respected chart as well as the Chart.yaml

@ericwyles
Copy link
Contributor Author

Hi @carminevassallo , I saw you assigned this to yourself. Please let me know if you have any questions or suggestions. Thank you!

@carminevassallo
Copy link
Contributor

Hi @ericwyles,

yes, I will review it and provide you with my feedback by the end of this week :)

Copy link
Contributor

@carminevassallo carminevassallo left a comment

Choose a reason for hiding this comment

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

Hey @ericwyles,

Thanks for your patience!

I was triggering the CI on your branch, and there seem to be issues during the static compatibility tests. Can you please check those tests and possibly adjust the outdated values?

Apart from that, I was reviewing your PR locally and didn't find any issues with it (apart from a small typo in the deployment template). It's actually a great contribution :)

Could you please add an entry in the CHANGELOG.md and Chart.yaml (artifacthub.io/changes) describing your contribution?

charts/sonarqube/templates/deployment.yaml Outdated Show resolved Hide resolved
@ericwyles
Copy link
Contributor Author

Hi @carminevassallo , I found an additional error and updated the templating so that sonarWebContext is still available to be used in the probes but doesn't get rendered in the templated yaml. (Used 'omit' on it). That should clear up the last syntax error I was able to find with the probes running the unit_helm_compatibility_test.sh locally.

In addition, I added a unit compatability test for 'deploymentType: Deployment' in an additional test file. I did this because I had the same syntax error in StatefulSet as well as Deployment, but only the StatefulSet one was being caught. I think this is ready for a re-review now.

@ericwyles
Copy link
Contributor Author

Hi @carminevassallo , checking back on this to see if we can get it re-reviewed and hopefully merged. Thanks again!

Copy link
Contributor

@carminevassallo carminevassallo left a comment

Choose a reason for hiding this comment

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

Hey @ericwyles,

Thanks for your patience. As you might know, we are focused on our own roadmap and review external contributions on a best effort basis.

The contribution is ready to be merged, we are gonna do something similar for the DCE edition. I tested the whole templating locally as well and your proposed changes work as intended :) Thanks also for the last minute fix of the typo, I was about to push the fix but you were already on it xD That's super cool!

I'm gonna squash and merge...

@carminevassallo carminevassallo merged commit a79f7cf into SonarSource:master May 30, 2024
6 of 9 checks passed
@ericwyles
Copy link
Contributor Author

Thanks @carminevassallo ! I totally understand and was just doing a periodic check in. Thanks for all your help and patience and getting this merged. I'll be on the lookout for the 10.6.0 release so we can adopt this in our project. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants