Skip to content

Support lifecycle hooks and fix terminationGracePeriodSeconds for SonarQube container#802

Open
Rumbles wants to merge 1 commit intoSonarSource:masterfrom
intenthq:SONAR-26367-lifecycle-hooks
Open

Support lifecycle hooks and fix terminationGracePeriodSeconds for SonarQube container#802
Rumbles wants to merge 1 commit intoSonarSource:masterfrom
intenthq:SONAR-26367-lifecycle-hooks

Conversation

@Rumbles
Copy link

@Rumbles Rumbles commented Mar 5, 2026

Summary

This PR addresses SONAR-26367, re-implementing the work from the previously closed #745.

Changes

  • Add lifecycle value to allow configuring container lifecycle hooks on the SonarQube container. This enables use cases such as a preStop hook to give the load balancer time to drain connections before the pod terminates — particularly important when running on spot/preemptible instances.
  • Fix terminationGracePeriodSeconds — this value has existed in values.yaml since v0.9.0 but was never rendered into the pod spec template. It was recently marked as (DEPRECATED) This value is not used in the templates in the 10.8.0 changelog, but we believe this is a bug rather than an intentional removal: the value is meaningless if it isn't applied. This PR wires it up correctly.

Example usage

# values.yaml
lifecycle:
  preStop:
    exec:
      command: ["/bin/sh", "-c", "sleep 40"]

terminationGracePeriodSeconds: 60

Checklist

  • Explain motives: graceful shutdown support for spot instance workloads and ALB draining
  • Changes documented in CHANGELOG.md

Relates to: https://sonarsource.atlassian.net/browse/SONAR-26367

…rQube container

- Add `lifecycle` value to allow configuring container lifecycle hooks
  (e.g. preStop hook for graceful ALB draining on spot instance termination)
- Fix `terminationGracePeriodSeconds` which was present in values.yaml
  but never rendered into the pod spec template

Relates to: https://sonarsource.atlassian.net/browse/SONAR-26367

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

2 participants