Hi,
How can I apply service check while registering external service(deployed on kubernetes) to consul also deployed on kubernetes (openshift)?
As the pod IP address seems changing, I can not possibly give the ip for service check? What steps are to be taken in this case ?
Thanks & Regards.
Hi,
I had the same issue
Found the solution!
spring.cloud.consul.discovery.health-check-url=http://${spring.application.name}-my-openshift-route-url/actuator/health
spring.cloud.consul.discovery.hostname=${spring.application.name}-my-openshift-route-url
spring.cloud.consul.discovery.port=80
spring.cloud.consul.discovery.scheme=http
So set
spring.cloud.consul.discovery.prefer-ip-address=false
spring.cloud.consul.discovery.prefer-agent-address=false
both to false and add the lines from the top block and you should be golden. Please note that spring.application.name needs to be the same as your OpenShift service name.