microscopic-river-74022
04/11/2024, 5:24 PMmicroscopic-river-74022
04/11/2024, 5:24 PMhealthCheck
field under services
. This field allows you to specify how the service's health should be checked after deploying.
Here's how you can add a health check to your RabbitMQ service:
yaml
kind: Module
description: Rabbitmq container
type: container
name: rabbitmq
image: rabbitmq:3.11.11-management-alpine@sha256:2d4ba07bc38699e2715ea9a1faeb7812be53a7a4c16b8b42936a4e2f696e6238
include: [./modules.garden.yml]
services:
- name: rabbitmq
ports:
- name: rabbitmq
containerPort: 5672
- name: rabbitmq-admin
containerPort: 15672
healthCheck:
command: [rabbitmqctl, status]
tasks:
- name: rabbitmq-clear
command: [rabbitmqctl, purge_queue, some-queue]
dependencies: [rabbitmq]
In this example, the rabbitmqctl status
command is used to check the health of the RabbitMQ service. Please replace this command with the appropriate command for your specific use case.
For more information, you can refer to the Garden documentation on health checks for container modules () and health check commands ().
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------bright-policeman-43626
04/11/2024, 5:38 PMkind: Module
description: Rabbitmq container
type: container
name: rabbitmq
image: rabbitmq:3.11.11-management-alpine@sha256:2d4ba07bc38699e2715ea9a1faeb7812be53a7a4c16b8b42936a4e2f696e6238
include: [./modules.garden.yml]
services:
- name: rabbitmq
ports:
- name: rabbitmq
containerPort: 5672
- name: rabbitmq-admin
containerPort: 15672
healthCheck:
command: ["/bin/sh", "-c", "nc -z localhost 5672 && echo OK || echo FAIL"]
tasks:
- name: rabbitmq-clear
command: [rabbitmqctl, purge_queue, some-queue]
dependencies: [rabbitmq]