AnjK
AnjK

Reputation: 3603

Kubernetes Liveness and readiness probes causing error logs 'http: TLS handshake error from 10.234.0.1:49330: EOF'

I am configuring readiness and liveness probes for my kuberenetes deployment.

Here is how i added it:

  ports:
    - name: http
      containerPort:  {{ .Values.service.internalPort }}
      protocol: TCP
  livenessProbe:
    tcpSocket:
      port: http
  readinessProbe:
    tcpSocket:
      port: http

But this is causing the error logs in the pod:

2021/03/24 03:23:06 http: TLS handshake error from 10.244.0.1:48476: EOF

If i remove the probes and create the deployment, this logs will not appear.

I have an ingress setup such that all the http requests to that container as https. Because my container expects only https requests to it.

I thought this error logs are shown because the tcp probes are not sending https requests here.

Is there some other way to setup probes without these error logs?

Upvotes: 1

Views: 4137

Answers (1)

Harsh Manvar
Harsh Manvar

Reputation: 30198

if you are looking forward to send to the HTTPS request to the service you have to change the scheme.

livenessProbe:
  httpGet:
    path: /
    port: 443
    scheme: HTTPS
readinessProbe:
  httpGet:
    path: /
    port: 443
    scheme: HTTPS

you can check more at : https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#http-probes

scheme: Scheme to use for connecting to the host (HTTP or HTTPS). Defaults to HTTP.

if HTTPS is set kubelet will send to HTTPS request or else by default it will be HTTP.

if request if failing you will see logs like : 400 bad request

10.165.18.52 - - [24/March/2021:17:06:40 +0000] "GET / HTTP/1.1" 400 271 "-" "kube-probe/1.16"

for the successful request, it will be 200 request

10.165.18.52 - - [24/March/2021:18:10:06 +0000] "GET / HTTP/1.1" 200 "-" "kube-probe/1.16"

Upvotes: 3

Related Questions