Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-15239

Dedicated liveness endpoint for K8 liveness probe

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9.1
    • Component/s: kubernetes
    • Labels:
      None
    • Edition:
      Community
    • Production Notes:
      None

      Description

      Until now, the K8 liveness probe has been relying on api/system/health status. This approach has several drawbacks:

      • During safe mode, the status is red (=SonarQube is not usable). But in the context of a liveness probe, we want a safe mode to be considered alive
      • On DCE, the health is the health of the cluster, not of the node. it's not accurate enough, and the K8 scheduler would reschedule healthy nodes because "the cluster is red".

      How:

      • remove "local" parameter on api/system/health that was introduced previously, it's replaced by api/system/liveness
      • create api/system/liveness endpoint, that return HTTP code 204 if the node is alive, and should not be killed:
        • Not a standalone setup (DCE multi-node): web process is green, CE process is green, DB is reachable
        • Standalone setup (CE/DE/EE or DCE single-node): web process is green, CE process is green, DB is reachable, ES is not red
        • any HTTP code outside of the range 200-299 means that the node should be killed and rescheduled
        • For all editions, on Safe Mode, only the database connexion is check
        • this new endpoint should support the same system passcode as api/system/health (X-Sonar-Passcode)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pierre.guillot Pierre Guillot
              Reporter:
              pierre.guillot Pierre Guillot
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: