Liveness Checks

This kind of check checks if the service is alive and responding to requests. It should be a quick check that only is for the current service. Not it's dependencies. If kubernetes finds a service not alive, it will restart the application within the container

spec:
  template:
    spec:
      containers:
      - name: reportinggateway
        livenessProbe:
          httpGet:
            path: /<<this service health check>>
            port: 80
            scheme: HTTP
          initialDelaySeconds: 10
          periodSeconds: 15

Readiness Checks

This kind of check is for if a service is ready to accept traffic. This is only run at the beginning when a container is first scheduled and started. If a container isn't ready the old version will not be removed. This keeps traffic flowing to a service that always is working.

spec:
  template:
    spec:
      containers:
      - name: reportinggateway
        readinessProbe:
          httpGet:
            path: /<<health check endpoint for dependancies>>
            port: 80
            scheme: HTTP
          initialDelaySeconds: 10
          periodSeconds: 15