Compare languages | Prometheus-мониторинг: настройки

Модуль не требует обязательной конфигурации (все работает из коробки).

The module does not require any configuration – it works right out-of-the-box.

Аутентификация

Authentication

По умолчанию используется модуль user-authn. Также можно настроить аутентификацию через externalAuthentication (см. ниже). Если эти варианты отключены, модуль включит basic auth со сгенерированным паролем и пользователем admin.

user-authn module provides authentication by default. Also, externalAuthentication can be configured (see below). If these options are disabled, the module will use basic auth with the auto-generated password and the user admin.

Посмотреть сгенерированный пароль можно командой:

Use kubectl to see password:

shell kubectl -n d8-system exec deploy/deckhouse – deckhouse-controller module values prometheus -o json | jq ‘.prometheus.internal.auth.password’

shell kubectl -n d8-system exec deploy/deckhouse – deckhouse-controller module values prometheus -o json | jq ‘.prometheus.internal.auth.password’

Чтобы сгенерировать новый пароль, нужно удалить Secret:

Delete the Secret to re-generate password:

shell kubectl -n d8-monitoring delete secret/basic-auth

shell kubectl -n d8-monitoring delete secret/basic-auth

Внимание! Параметр auth.password больше не поддерживается.

Note! The auth.password parameter is deprecated.

Примечание

Notes

  • retentionSize для main и longterm рассчитывается автоматически, возможности задать значение нет!
  • Алгоритм расчета:
  • pvc_size * 0.8 — если PVC существует;
  • 10 GiB — если PVC нет и StorageClass поддерживает ресайз;
  • 25 GiB — если PVC нет и StorageClass не поддерживает ресайз.
  • Если используется local-storage и требуется изменить retentionSize, необходимо вручную изменить размер PV и PVC в нужную сторону. Внимание! Для расчета берется значение из .status.capacity.storage PVC, поскольку оно отражает рельный размер PV в случае ручного ресайза.
  • Размер дисков Prometheus можно изменить стандартным для Kubernetes способом (если в StorageClass это разрешено), отредактировав в PersistentVolumeClaim поле .spec.resources.requests.storage.
  • retentionSize for the main and longterm Prometheus is calculated automatically; you cannot set this value manually!
  • The following calculation algorithm is used:
  • pvc_size * 0.8 — if the PVC exists;
  • 10 GiB — if there is no PVC and if the StorageClass supports resizing;
  • 25 GiB — if there is no PVC and if the StorageClass does not support resizing;
  • If the local-storage is used, and you have to change the retentionSize, then you need to manually change the size of the PV and PVC. Caution! Note that the value from .status.capacity.storage PVC is used for the calculation since it reflects the actual size of the PV in the case of manual resizing.
  • You can change the size of Prometheus disks in the standard Kubernetes way (if the StorageClass permits this) by editing the .spec.resources.requests.storage field of the PersistentVolumeClaim resource.