<p>I am configuring readiness and liveness probes for my kuberenetes deployment.</p>
<p>Here is how i added it:</p>
<pre><code>  ports:
    - name: http
      containerPort:  {{ .Values.service.internalPort }}
      protocol: TCP
  livenessProbe:
    tcpSocket:
      port: http
  readinessProbe:
    tcpSocket:
      port: http
</code></pre>
<p>But this is causing the error logs in the pod:</p>
<pre><code>2021/03/24 03:23:06 http: TLS handshake error from 10.244.0.1:48476: EOF
</code></pre>
<p>If i remove the probes and create the deployment, this logs will not appear.</p>
<p>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.</p>
<p>I thought this error logs are shown because the tcp probes are not sending https requests here.</p>
<p>Is there some other way to setup probes without these error logs?</p>

<p>if you are looking forward to send to the HTTPS request to the service you have to change the <code>scheme</code>.</p>
<pre><code>livenessProbe:
  httpGet:
    path: /
    port: 443
    scheme: HTTPS
readinessProbe:
  httpGet:
    path: /
    port: 443
    scheme: HTTPS
</code></pre>
<p>you can check more at : <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#http-probes" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#http-probes</a></p>
<p>scheme: Scheme to use for connecting to the host (HTTP or HTTPS). Defaults to HTTP.</p>
<p>if HTTPS is set <strong>kubelet</strong> will send to HTTPS request or else by default it will be HTTP.</p>
<p>if request if failing you will see logs like : 400 bad request</p>
<pre><code>10.165.18.52 - - [24/March/2021:17:06:40 +0000] &quot;GET / HTTP/1.1&quot; 400 271 &quot;-&quot; &quot;kube-probe/1.16&quot;
</code></pre>
<p>for the successful request, it will be <strong>200</strong> request</p>
<pre><code>10.165.18.52 - - [24/March/2021:18:10:06 +0000] &quot;GET / HTTP/1.1&quot; 200 &quot;-&quot; &quot;kube-probe/1.16&quot;
</code></pre>
