deemaxx
deemaxx

Reputation: 1

Kubernetes http livenessProbe use https?

We have an http livenessProbe setup

  livenessProbe:
    httpGet:
      path: /admin
      port: http
    initialDelaySeconds: 180
    periodSeconds: 20

but why in the description the connection is via https

Liveness probe failed: Get https://10.11.1.7:80/admin: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

Upvotes: 0

Views: 1799

Answers (1)

Arghya Sadhu
Arghya Sadhu

Reputation: 44559

Kubernetes is doing exactly what you are asking, probing the http url but your application pod web server is redirecting it to https, that is causing the error.

You can either fix that in pod or use TCP probe

apiVersion: v1
kind: Pod
metadata:
  name: goproxy
  labels:
    app: goproxy
spec:
  containers:
  - name: goproxy
    image: k8s.gcr.io/goproxy:0.1
    ports:
    - containerPort: 8080
    readinessProbe:
      tcpSocket:
        port: 8080
      initialDelaySeconds: 5
      periodSeconds: 10
    livenessProbe:
      tcpSocket:
        port: 8080
      initialDelaySeconds: 15
      periodSeconds: 20

Upvotes: 2

Related Questions