Home > Software engineering >  Kubernetes - Liveness httpGet probe closes the connection before reading the entire body
Kubernetes - Liveness httpGet probe closes the connection before reading the entire body

Time:01-15

Below is the current configuration of my liveness probe:

  livenessProbe:
      httpGet:
        path: /connectors
        port: 8083
        scheme: HTTP
      initialDelaySeconds: 120
      periodSeconds: 60
      successThreshold: 1
      failureThreshold: 3
      timeoutSeconds: 15

Kubelet pings the endpoint and gets 200. However, the probe closes the connection before reading the entire body. This is causing the server to have broken pipes.

Is there a way to ensure that kubelet reads the entire body before closing the connection?

Note: My probe doesn't have to rely on the response body.

CodePudding user response:

httpGet probe has hardcoded code to read only a 10 KB response. Anything beyond that will not be read. So, it is impossible to read the complete response from the liveness probe.

Alternate solution: Fixing the health check endpoint to deliver a minimal body is an alternate solution.

  • Related