0
votes

We are using OpenShift Online Pro.

I have an app where I want to add a readiness health check. If I check the URL from my laptop it is good:

simon$ curl --head  http://x.y.pro-eu-west-1.openshiftapps.com/api/ready
HTTP/1.1 200 OK

If I use the console to add the checks it suggests "HTTP GET", "/api/ready" on the listening port "8080". The docs at https://docs.openshift.com/online/dev_guide/application_health.html suggest 15s delay and 1s timeout might be reasonable so I give that a go.

Exporting the dc/backend shows:

readinessProbe:
      failureThreshold: 3
      httpGet:
        path: /api/ready
        port: 8080
        scheme: HTTP
      initialDelaySeconds: 15
      periodSeconds: 10
      successThreshold: 1
      timeoutSeconds: 1

This gives events with errors such as:

Readiness probe failed: Get http://10.130.7.168:8080/api/ready: dial tcp 10.130.7.168:8080: getsockopt: connection refused

The app is PHP so fast to start but after 5 minutes and 28 of those warnings I give up and delete the health check.

If I then wait to see "Created container" for the next deployment I can go and curl the "/api/ready" inside of one minute and get a healthy response.

What am I missing to get the check to work?

1
And you are using the supplied PHP S2I builder, or your own PHP image?Graham Dumpleton
good point. deployed in the standard php s2i and sample app and it worked fine and the pod logs showed the polling "Go-http-client/1.1" requests. I could open a terminal and curl it and see "curl/7.29.0" in the logs. If I open a terminal to my image built with a custom s2i it cannot do a curl to http://localhost:8080/index.php. So it seems that the server isn't accepting traffic accept from the public route.simbo1905
The php s2i sample doesn't come with readiness probe checks. Did you add one? Have you tried to increase the timeoutSeconds value to other than 1?Michael Johann
@WillGordon wow. if i go in on the terminal tab of the pod on the web console and curl http://localhost:8000/api/ready it gives a "$?" of 0. if I curl http://localhost:8080/api/ready I get connection denied. Yet I haven't seen anything in the config that names 8000. nor anything in my question.simbo1905
Sorry, I only knew to look at port 8000 because I work for OpenShift, and based on your dc/backend I was able to find your project. Then using oc get all I saw your service was configured to serve port 8000.Will Gordon

1 Answers

0
votes

My bad. I set up the checks via the Web Console and it suggests port 8080 by default. Yet the s2i I am using is listening on 8000.