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

Various fixes to health check scripts #3002

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Unset default value for GITLAB_MONITORING_IP_WHITELIST
On upstream, expected default value is `127.0.0.1/8`
and it is already listed in corresponding configuration.
`GITLAB_MONITORING_IP_WHITELIST` is used to allow monitoring from hosts other than loopback (localhost).

So just unset default value for it.
If the value is not set, the line specifying this "additional" IP range will be removed.
  • Loading branch information
kkimurak committed Sep 20, 2024
commit ba429ab996c21ae5c7ab502f20b71b3390155fec
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1611,7 +1611,7 @@ Time between sampling of unicorn socket metrics, in seconds, defaults to `10`

##### `GITLAB_MONITORING_IP_WHITELIST`

IP whitelist to access monitoring endpoints, defaults to `0.0.0.0/8`
IP whitelist to access monitoring endpoints. No defaults.

##### `GITLAB_MONITORING_SIDEKIQ_EXPORTER_ENABLED`

Expand Down
2 changes: 1 addition & 1 deletion assets/runtime/env-defaults
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ GITLAB_SHELL_CUSTOM_HOOKS_DIR=${GITLAB_SHELL_CUSTOM_HOOKS_DIR:-"$GITLAB_SHELL_IN

## MONITORING
GITLAB_MONITORING_UNICORN_SAMPLER_INTERVAL=${GITLAB_MONITORING_UNICORN_SAMPLER_INTERVAL:-10}
GITLAB_MONITORING_IP_WHITELIST=${GITLAB_MONITORING_IP_WHITELIST:-"0.0.0.0/8"}
GITLAB_MONITORING_IP_WHITELIST=${GITLAB_MONITORING_IP_WHITELIST:-}
GITLAB_MONITORING_SIDEKIQ_EXPORTER_ENABLED=${GITLAB_MONITORING_SIDEKIQ_EXPORTER_ENABLED:-true}
GITLAB_MONITORING_SIDEKIQ_EXPORTER_ADDRESS=${GITLAB_MONITORING_SIDEKIQ_EXPORTER_ADDRESS:-"0.0.0.0"}
GITLAB_MONITORING_SIDEKIQ_EXPORTER_PORT=${GITLAB_MONITORING_SIDEKIQ_EXPORTER_PORT:-3807}
Expand Down
4 changes: 4 additions & 0 deletions assets/runtime/functions
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,10 @@ gitlab_configure_gitaly() {
gitlab_configure_monitoring() {
echo "Configuring gitlab::monitoring..."

if [ "${GITLAB_MONITORING_IP_WHITELIST}" == "" ]; then
exec_as_git sed -i "/{{GITLAB_MONITORING_IP_WHITELIST}}/d" ${GITLAB_CONFIG}
fi

update_template ${GITLAB_CONFIG} \
GITLAB_MONITORING_UNICORN_SAMPLER_INTERVAL \
GITLAB_MONITORING_IP_WHITELIST \
Expand Down