Skip to content

Android worker Health check

The worker container supports a liveness probe responding the GET request at /healthz. You can use it in order to restart the worker if it has issues to run, i.e. it crashed.

Health check with Docker Compose#

To add a check when running Emcee via Docker Compose, you need to add an additional healthcheck block to the docker-compose.yml file. For example:

docker-compose.yml
#...
  queue-worker:
    #...
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:41001/healthz"]
      interval: 1m
      timeout: 10s
      retries: 3
      start_period: 1m
#...

Official doc for such health check.

Health check with Kubernetes#

To add a check to Kubernetes, you need to add an additional block livenessProbe and startupProbe (for checking when the pod starts) to the emcee-worker-deployment.yaml file. For example:

emcee-worker-deployment.yaml
# ...
      containers:
        - name: emcee-worker
          # ...
          livenessProbe:
            httpGet:
              path: /healthz
              port: 41001
            failureThreshold: 2
            initialDelaySeconds: 15
            periodSeconds: 15
          startupProbe:
            httpGet:
              path: /healthz
              port: 41001
            failureThreshold: 2
            periodSeconds: 10
# ...

Official doc for such health check.