Commit 70b9e3e6 authored by Roy Zwambag's avatar Roy Zwambag Committed by Achilleas Pipinellis

Add optional instructions on how to enable Sidekiq health checks

parent 1b49113d
...@@ -14,42 +14,43 @@ the package will assume the defaults as noted below. ...@@ -14,42 +14,43 @@ the package will assume the defaults as noted below.
See the table below for the list of ports that the Omnibus GitLab assigns See the table below for the list of ports that the Omnibus GitLab assigns
by default: by default:
| Component | On by default | Communicates via | Alternative | Connection port | | Component | On by default | Communicates via | Alternative | Connection port |
|:-------------------:|:-------------:|:----------------:|:-----------:|:------------------------------------------:| |:--------------------:|:-------------:|:----------------:|:-----------:|:------------------------------------------:|
| GitLab Rails | Yes | Port | X | 80 or 443 | | GitLab Rails | Yes | Port | X | 80 or 443 |
| GitLab Shell | Yes | Port | X | 22 | | GitLab Shell | Yes | Port | X | 22 |
| PostgreSQL | Yes | Socket | Port (5432) | X | | PostgreSQL | Yes | Socket | Port (5432) | X |
| Redis | Yes | Socket | Port (6379) | X | | Redis | Yes | Socket | Port (6379) | X |
| Puma | Yes | Socket | Port (8080) | X | | Puma | Yes | Socket | Port (8080) | X |
| GitLab Workhorse | Yes | Socket | Port (8181) | X | | GitLab Workhorse | Yes | Socket | Port (8181) | X |
| NGINX status | Yes | Port | X | 8060 | | NGINX status | Yes | Port | X | 8060 |
| Prometheus | Yes | Port | X | 9090 | | Prometheus | Yes | Port | X | 9090 |
| Node exporter | Yes | Port | X | 9100 | | Node exporter | Yes | Port | X | 9100 |
| Redis exporter | Yes | Port | X | 9121 | | Redis exporter | Yes | Port | X | 9121 |
| PostgreSQL exporter | Yes | Port | X | 9187 | | PostgreSQL exporter | Yes | Port | X | 9187 |
| PgBouncer exporter | No | Port | X | 9188 | | PgBouncer exporter | No | Port | X | 9188 |
| GitLab Exporter | Yes | Port | X | 9168 | | GitLab Exporter | Yes | Port | X | 9168 |
| Sidekiq exporter | Yes | Port | X | 8082 | | Sidekiq exporter | Yes | Port | X | 8082 |
| Puma exporter | No | Port | X | 8083 | | Sidekiq health check | No | Port | X | 8092[^Sidekiq-health] |
| Geo PostgreSQL | No | Socket | Port (5431) | X | | Puma exporter | No | Port | X | 8083 |
| Redis Sentinel | No | Port | X | 26379 | | Geo PostgreSQL | No | Socket | Port (5431) | X |
| Incoming email | No | Port | X | 143 | | Redis Sentinel | No | Port | X | 26379 |
| Elastic search | No | Port | X | 9200 | | Incoming email | No | Port | X | 143 |
| GitLab Pages | No | Port | X | 80 or 443 | | Elastic search | No | Port | X | 9200 |
| GitLab Registry | No* | Port | X | 80, 443 or 5050 | | GitLab Pages | No | Port | X | 80 or 443 |
| GitLab Registry | No | Port | X | 5000 | | GitLab Registry | No* | Port | X | 80, 443 or 5050 |
| LDAP | No | Port | X | Depends on the component configuration | | GitLab Registry | No | Port | X | 5000 |
| Kerberos | No | Port | X | 8443 or 8088 | | LDAP | No | Port | X | Depends on the component configuration |
| OmniAuth | Yes | Port | X | Depends on the component configuration | | Kerberos | No | Port | X | 8443 or 8088 |
| SMTP | No | Port | X | 465 | | OmniAuth | Yes | Port | X | Depends on the component configuration |
| Remote syslog | No | Port | X | 514 | | SMTP | No | Port | X | 465 |
| Mattermost | No | Port | X | 8065 | | Remote syslog | No | Port | X | 514 |
| Mattermost | No | Port | X | 80 or 443 | | Mattermost | No | Port | X | 8065 |
| PgBouncer | No | Port | X | 6432 | | Mattermost | No | Port | X | 80 or 443 |
| Consul | No | Port | X | 8300, 8301(UDP), 8500, 8600[^Consul-notes] | | PgBouncer | No | Port | X | 6432 |
| Patroni | No | Port | X | 8008 | | Consul | No | Port | X | 8300, 8301(UDP), 8500, 8600[^Consul-notes] |
| GitLab KAS | No | Port | X | 8150 | | Patroni | No | Port | X | 8008 |
| Gitaly | No | Port | X | 8075 | | GitLab KAS | No | Port | X | 8150 |
| Gitaly | No | Port | X | 8075 |
Legend: Legend:
...@@ -70,3 +71,5 @@ NOTE: ...@@ -70,3 +71,5 @@ NOTE:
In some cases, the GitLab Registry will be automatically enabled by default. Please see [our documentation](../packages/container_registry.md) for more details In some cases, the GitLab Registry will be automatically enabled by default. Please see [our documentation](../packages/container_registry.md) for more details
[^Consul-notes]: If using additional Consul functionality, more ports may need to be opened. See the [official documentation](https://www.consul.io/docs/install/ports#ports-table) for the list. [^Consul-notes]: If using additional Consul functionality, more ports may need to be opened. See the [official documentation](https://www.consul.io/docs/install/ports#ports-table) for the list.
[^Sidekiq-health]: If Sidekiq health check settings are not set, they will default to the Sidekiq metrics exporter settings. This default is deprecated and is set to be removed in [GitLab 15.0](https://gitlab.com/gitlab-org/gitlab/-/issues/347509).
...@@ -21,8 +21,6 @@ you want using steps 1 and 2 from the GitLab downloads page. ...@@ -21,8 +21,6 @@ you want using steps 1 and 2 from the GitLab downloads page.
1. Generate the Sidekiq configuration: 1. Generate the Sidekiq configuration:
```ruby ```ruby
sidekiq['listen_address'] = "10.10.1.48"
## Optional: Enable extra Sidekiq processes ## Optional: Enable extra Sidekiq processes
sidekiq_cluster['enable'] = true sidekiq_cluster['enable'] = true
sidekiq['queue_groups'] = [ sidekiq['queue_groups'] = [
...@@ -128,6 +126,34 @@ you want using steps 1 and 2 from the GitLab downloads page. ...@@ -128,6 +126,34 @@ you want using steps 1 and 2 from the GitLab downloads page.
external_url 'https://gitlab.example.com' external_url 'https://gitlab.example.com'
``` ```
1. (Optional) If you want to collect Sidekiq metrics, enable the Sidekiq metrics server.
To make metrics available from `localhost:8082/metrics`, set the following values:
```ruby
sidekiq['metrics_enabled'] = true
sidekiq['listen_address'] = "localhost"
sidekiq['listen_port'] = "8082"
# Optionally log all the metrics server logs to log/sidekiq_exporter.log
sidekiq['exporter_log_enabled'] = true
```
1. (Optional) If you use health check probes to observe Sidekiq,
set a separate port for health checks.
Configuring health checks is only necessary if there is something that actually probes them.
For more information about health checks, see the [Sidekiq health check page](sidekiq_health_check.md).
Enable health checks for Sidekiq:
```ruby
sidekiq['health_checks_enabled'] = true
sidekiq['health_checks_listen_address'] = "localhost"
sidekiq['health_checks_listen_port'] = "8092"
```
NOTE:
If health check settings are not set, they will default to the metrics exporter settings.
This default is deprecated and is set to be removed in [GitLab 15.0](https://gitlab.com/gitlab-org/gitlab/-/issues/347509).
1. Run `gitlab-ctl reconfigure`. 1. Run `gitlab-ctl reconfigure`.
You will need to restart the Sidekiq nodes after an update has occurred and database You will need to restart the Sidekiq nodes after an update has occurred and database
...@@ -196,7 +222,13 @@ gitlab_rails['auto_migrate'] = false ...@@ -196,7 +222,13 @@ gitlab_rails['auto_migrate'] = false
####################################### #######################################
### Sidekiq configuration ### ### Sidekiq configuration ###
####################################### #######################################
sidekiq['listen_address'] = "10.10.1.48" sidekiq['metrics_enabled'] = true
sidekiq['exporter_log_enabled'] = false
sidekiq['listen_port'] = "8082"
sidekiq['health_checks_enabled'] = true
sidekiq['health_checks_listen_address'] = "localhost"
sidekiq['health_checks_listen_port'] = "8092"
####################################### #######################################
### Monitoring configuration ### ### Monitoring configuration ###
...@@ -230,3 +262,4 @@ Related Sidekiq configuration: ...@@ -230,3 +262,4 @@ Related Sidekiq configuration:
1. [Extra Sidekiq processes](operations/extra_sidekiq_processes.md) 1. [Extra Sidekiq processes](operations/extra_sidekiq_processes.md)
1. [Extra Sidekiq routing](operations/extra_sidekiq_routing.md) 1. [Extra Sidekiq routing](operations/extra_sidekiq_routing.md)
1. [Using the GitLab-Sidekiq chart](https://docs.gitlab.com/charts/charts/gitlab/sidekiq/) 1. [Using the GitLab-Sidekiq chart](https://docs.gitlab.com/charts/charts/gitlab/sidekiq/)
1. [Sidekiq health checks](sidekiq_health_check.md)
---
stage: Enablement
group: Distribution
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---
# Sidekiq Health Check **(FREE SELF)**
GitLab provides liveness and readiness probes to indicate service health and
reachability to the Sidekiq cluster. These endpoints
[can be provided to schedulers like Kubernetes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)
to hold traffic until the system is ready or restart the container as needed.
The health check server can be set up when [configuring Sidekiq](sidekiq.md).
## Readiness
The readiness probe checks whether the Sidekiq workers are ready to process jobs.
```plaintext
GET /readiness
```
Assuming you set up Sidekiq's address and port to be `localhost` and `8092` respectively,
here's an example request:
```shell
curl "http://localhost:8092/readiness"
```
On success, the endpoint returns a `200` HTTP status code, and a response like the following:
```json
{
"status": "ok"
}
```
## Liveness
Checks whether the Sidekiq cluster is running.
```plaintext
GET /liveness
```
Assuming you set up Sidekiq's address and port to be `localhost` and `8092` respectively,
here's an example request:
```shell
curl "http://localhost:8092/liveness"
```
On success, the endpoint returns a `200` HTTP status code, and a response like the following:
```json
{
"status": "ok"
}
```
...@@ -131,6 +131,10 @@ On failure, the endpoint returns a `503` HTTP status code. ...@@ -131,6 +131,10 @@ On failure, the endpoint returns a `503` HTTP status code.
This check is being exempt from Rack Attack. This check is being exempt from Rack Attack.
## Sidekiq
Learn how to configure the [Sidekiq health checks](../../../administration/sidekiq_health_check.md).
<!-- ## Troubleshooting <!-- ## Troubleshooting
Include any troubleshooting steps that you can foresee. If you know beforehand what issues Include any troubleshooting steps that you can foresee. If you know beforehand what issues
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment