How to define Ingress in GKE, with Spring Cloud Netflix containers

8/15/2020

I have a microservice architecture, build on Spring Cloud Netflix:

  • business-owner-service points to a Spring Boot app that runs on port 8763. Port forwarding is done, business-owner-service:80 redirects to port 8763. enter image description here
  • customer-service points to a Spring Boot app that runs on port 8766. customer-service:80 -> 8766

The architecture runs correctly if I invoke it via the Spring Cloud Zuul gateway but I wish to set up an Ingress.

My exact configuration is the following:

  • ingress enter image description here
  • ingress path configuration

enter image description here

The problem is that the ingress has all backend services on unhealthy and I don't know what I'm doing wrong. What do I must do in order to have a working Ingress?

Edit: Per comments, I tried to define readinessProbe, for customer-service pod, as follows: enter image description here

This doesn't work, and when I try to double check updated configuration, readinessProbe is not visible. I think this is a bug, but I am not sure how to check that the probe is updated or not.

Also, actuator/health GET is running through Zuul gateway: enter image description here

-- 2dor
google-kubernetes-engine
kubernetes
kubernetes-ingress
spring-cloud-netflix

2 Answers

8/15/2020

GKE ingress controller performs health check with the readiness probe defined in pod deployment. Add a readiness probe as below using spring boot actuator

spec:
  containers:
    - name: name
      readinessProbe:
        httpGet:
          port: 8080
          path: /actuator/health
        initialDelaySeconds: 10
-- Arghya Sadhu
Source: StackOverflow

8/19/2020

What ended up being the solution in my case was the health check configuration, not readinessProbe. I updated the health check that automatically were created for the ingress backend services to point to /actuator/health. This worked

-- 2dor
Source: StackOverflow