Adding a health check path on Prisma docker container

11/29/2018

I'm hosting my Prisma docker container on a Kubernetes cluster that requires a health check path to determine whether the container is alive. Since I don't have any control over the endpoints in this container, how would I add a health check route that Kubernetes could hit?

-- dargue3
docker
kubernetes
prisma

1 Answer

11/29/2018

Add this to your prisma container manifest file. If you deploy prisma by a deployment, run:

$ kubectl edit deployment <prisma_deployment_name> --namespace <namespace>

And put the following probe spec in the prisma container spec.


    livenessProbe:
      httpGet:
        path: /
        port: 4466
      # Number of seconds after the container has started before probes are initiated.
      initialDelaySeconds: 120
      # How often (in seconds) to perform the probe.
      periodSeconds: 10
      # Number of seconds after which the probe times out.
      timeoutSeconds: 60
    readinessProbe:
      httpGet:
        path: /
        port: 4466
      # Number of seconds after the container has started before probes are initiated.
      initialDelaySeconds: 120
      # How often (in seconds) to perform the probe.
      periodSeconds: 10
      # Number of seconds after which the probe times out.
      timeoutSeconds: 60
-- Shudipta Sharma
Source: StackOverflow