<p>I'm deploying a microservices nodejs express application to GKE, I successfully deployed the services (one as Ingress service with static IP @ and one as NodePort service which will not be exposed to Internet).</p>

<p>Now I'm trying to deploy the api gateway which is an express-gateway application, I deployed it in first time as a LoadBalancer service and it's working , here is my service code : </p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: express-gateway-balancer
spec:
  selector:
    app: express-gateway
  type: LoadBalancer
  ports:
    - protocol: TCP
      port: 80
      targetPort: 8080
</code></pre>

<p><a href="https://i.stack.imgur.com/RhfHm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RhfHm.png" alt="LoadBalancer Service"></a></p>

<p>Now I must transform the trafic to HTTPS to be able to call the API endpoints front my react frontend application which is running with HTTPS, so I did a research and the way is to expose the api gateway application as an Ingress not LoadBalancer.</p>

<p>So I did the changes (the same I did with the rest of my deployments)and created a static IP @ "gateway-ip" to expose it via Ingress : </p>

<p>Here is my service.yaml file : </p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: express-gateway-service
spec:
  selector:
    app: express-gateway
  type: NodePort
  ports:
    - protocol: TCP
      port: 80
      targetPort: 8080
</code></pre>

<p>My Ingress.yaml file : </p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: gateway-service-ingress
  annotations:
    kubernetes.io/ingress.global-static-ip-name: "gateway-ip"
spec:
  backend:
    serviceName: express-gateway-service
    servicePort: 80
</code></pre>

<p>Here is my deployment file : </p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: express-gateway
  labels:
    app: express-gateway
spec:
  selector:
    matchLabels:
      app: express-gateway
  replicas: 3
  template:
    metadata:
      labels:
        app: express-gateway
    spec:
      containers:
        - name:  express-gateway
          image: gcr.io/PROJECT_ID/apigatewayservice:v1
          ports:
            - name: gateway
              containerPort: 8080
            - name: admin
              containerPort: 9876
</code></pre>

<p>Here are screenshot of the error I got : </p>

<p><a href="https://i.stack.imgur.com/H89n3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/H89n3.png" alt="Service error console"></a>
<a href="https://i.stack.imgur.com/JMzhq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JMzhq.png" alt="Service error browser"></a></p>

<p>Any solutions ? Thanks </p>

DevGeek344
<p>Do you have a default endpoint of all your scheduled pods? I mean "/" ? Ingress does the health check readiness prob inbuilt that checks if "/" is reachable or not. If not, it will declare it as unhealthy.
Hope this helps.</p>
