Kubernetes Probes

We recommend that you set below probes for your deployment.

StartUp Probe

The kubelet uses startup probes to know when a container application has started.

If such a probe is configured, it disables liveness and readiness checks until it succeeds, making sure those probes don’t interfere with the application startup.

This can be used to adopt liveness checks on slow starting containers, avoiding them getting killed by the kubelet before they are up and running.

spec:
  template:
    spec:
      containers:
        - name: {{ .Chart.Name }}
          startupProbe:
            httpGet:
              path: /health
              port: http
              scheme: HTTP
            timeoutSeconds: 10    # number of seconds before marking the probe as timing out (failing the health check)
            periodSeconds: 10     # how often to check the probe
            successThreshold: 1   # minimum number of consecutive successful checks
            failureThreshold: 30  # number of retries before marking the probe as failed

In above configuration, the probe checks /health endpoint every 10 seconds until 5 mins (periodSeconds * failureThreshold = 300s).

Within that period if the health check endpoint returns success, then it would turn on liveness and readiness probes. Otherwise, it would fail.

Readiness Probe

Readiness probes are designed to let Kubernetes know when your app is ready to serve traffic.

spec:
  template:
    spec:
      containers:
        - name: {{ .Chart.Name }}
          readinessProbe:
            httpGet:
              path: /health
              port: http
              scheme: HTTP
            timeoutSeconds: 10
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 3

Liveness Probe

spec:
  template:
    spec:
      containers:
        - name: {{ .Chart.Name }}
          livenessProbe:
            httpGet:
              path: /health
              port: http
              scheme: HTTP
            timeoutSeconds: 10
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 3