Примеры составления healthcheck

healthcheck:
test: [«CMD», «http://localhost:1234»]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s

__________________________________

elasticsearch

healthcheck:
test: [«CMD-SHELL», «curl —silent —fail localhost:9200/_cluster/health || exit 1»]
interval: 10s
timeout: 10s
retries: 3

___________________________________

sql

healthcheck:
test: [«CMD-SHELL», «/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P example_123 -Q ‘SELECT 1’ || exit 1»]
interval: 10s
retries: 10
start_period: 10s
timeout: 3s

_____________________________________

sql (mariadb)

healthcheck:
test: [‘CMD-SHELL’, ‘mysqladmin ping -h 127.0.0.1 —password=»$$(cat /run/secrets/db-password)» —silent’]
interval: 3s
retries: 5
start_period: 30s

__________________________________

sql (mariadb)

healthcheck:
test: [«CMD», «mysqladmin», «ping», «-h», «127.0.0.1», «—silent»]
interval: 3s
retries: 5
start_period: 30s

______________________________________________

PostgreSQL

healthcheck:
test: [ «CMD», «pg_isready» ]
interval: 10s
timeout: 5s
retries: 5

 healthcheck:
      test: [ "CMD-SHELL", "pg_isready -U postgres_user -d postgres_db" ]
      interval: 30s
      timeout: 10s
      retries: 5

_______________________________

nginx

healthcheck:
test: [«CMD-SHELL», «curl —silent —fail localhost:80/health-check || exit 1»]
interval: 10s
timeout: 10s
retries: 3

_________________________

flask

healthcheck:
test: [«CMD-SHELL», «curl —silent —fail localhost:8000/flask-health-check || exit 1»]
interval: 10s
timeout: 10s
retries: 3

От denerk

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *