Kubernetes liveness probe httpGet schema not working correctly Kubernetes liveness probe httpGet schema not working correctly kubernetes kubernetes

Kubernetes liveness probe httpGet schema not working correctly


Since you are explicitly stating livenessProbe to use HTTP, it's probably your application that redirects traffic to HTTPS. Make sure that your application returns a 200 OK on basepath /, and not a redirection (any of 3xx codes).

You can either fix that, or use TCP probe

apiVersion: v1kind: Podmetadata:  name: goproxy  labels:    app: goproxyspec:  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