Liveness probe failed: Get http://192.168.9.69:8080/health: read tcp 10.9.44.118:44143->192.168.9.69:8080: read: connection reset by peer

10/19/2018

I keep getting this error when I run my application in a Docker container in a pod on Kubernetes. These are some important snippets of the files.

main.py

class RedditServiceSpinnakerNotifications(object):
def is_healthy(self, request):
    return {'status': 200}


controller = RedditServiceSpinnakerNotifications()
configurator.add_route('health', '/health', request_method='GET')
configurator.add_view(controller.is_healthy, route_name="health",
                      renderer="json")

Dockerfile

EXPOSE 8080
WORKDIR /src
VOLUME /src
COPY . /src
CMD python3 setup.py develop && python3 setup.py build && baseplate-serve3 --debug --bind 0.0.0.0:8080 --reload example.ini

Deployment.yaml

livenessProbe:
   httpGet:
     path: {{ .Values.app.healthcheck.endpoint }}
     port: {{ .Values.service.internalPort }}
     initialDelaySeconds: {{ .Values.app.healthcheck.initialDelaySeconds }}
        timeoutSeconds: 10

values.yaml

app:
  healthcheck:
    endpoint: /health
    type: http
    port: 8080
    initialDelaySeconds: 10

service:
  type: ClusterIP
  externalPort: 80
  internalPort: 8080

Error message when I run kubectl logs

Liveness probe failed: Get http://192.168.9.69:8080/health: read tcp 10.9.44.118:44171->192.168.9.69:8080: read: connection reset by peer

The pod is in a crash loop backoff state, you I cannot exec into it.

-- clout_chaser
docker
dockerfile
kubernetes
kubernetes-helm

0 Answers