<p>Hello I am writing a application which I want to run in GKE and here is my deployment</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: chopcast-dev
spec:
  selector:
    matchLabels:
      app: chopcast-dev
  replicas: 3
  template:
    metadata:
      labels:
        app: chopcast-dev
    spec:
      containers:
      - name: chopcast-dev
        image: eu.gcr.io/valued-amp-998877/chopcast:latest
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /api/v1/healthz
            port: 5000
            scheme: HTTP
          initialDelaySeconds: 60
          periodSeconds: 60
          successThreshold: 1
          timeoutSeconds: 10
        readinessProbe:
          failureThreshold: 3
          httpGet:
            path: /api/v1/healthz
            port: 5000
            scheme: HTTP
          initialDelaySeconds: 60
          periodSeconds: 60
          successThreshold: 1
          timeoutSeconds: 10
        ports:
        - containerPort: 5000
</code></pre>
<p>Here is the service</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: chopcast-dev-service
spec:
  selector:
    app: chopcast-dev
  ports:
  - protocol: &quot;TCP&quot;
    port: 5000
    targetPort: 5000
  type: LoadBalancer
</code></pre>
<p>and here is the ingress</p>
<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: chopcast-dev-ingress
  annotations:
    kubernetes.io/ingress.global-static-ip-name: gke-tribetacttics-static-ip
    networking.gke.io/managed-certificates: chopcast-dev-certificate
    #kubernetes.io/ingress.allow-http: &quot;false&quot;
spec:
  backend:
    serviceName: &quot;chopcast-dev-service&quot;
    servicePort: 5000
  rules:
  - http:
      paths:
      - backend:
          serviceName: &quot;chopcast-dev-service&quot;
          servicePort: 5000
    host: &quot;gke.abcd.com&quot;
</code></pre>
<p>every time I get my service running successfully and when I run the exposed service with the assigned IP it works file ie</p>
<p><code>x.x.x.x:5000/api/v1/healthz</code></p>
<p>But whenever I put the ingress static IP I always get</p>
<pre><code>Error: Server Error
The server encountered a temporary error and could not complete your request.
Please try again in 30 seconds.
</code></pre>
<p>I tried with BackendConfig too.
As per the documentation, the health should pick up from the readinessProbe but it seems it is not picking up as I can see in load balancer section it is 0/1 backend is up. Unfortunately, I don't want to serve 200 on the / route.</p>
<p>Please help.</p>

Dave
<p>Finally, I figured out what was going wrong. The readinessProbe path should have a trailing slash as my application is designed that way.</p>
<pre><code>      readinessProbe:
          failureThreshold: 3
          httpGet:
            path: /api/v1/healthz/
            port: 5000
            scheme: HTTP
          initialDelaySeconds: 60
          periodSeconds: 60
          successThreshold: 1
          timeoutSeconds: 10
</code></pre>
<p>Here are few checklist</p>
<ol>
<li>Check your application name, namespace and labels.</li>
<li>Use selectors and check all selectors are proper.</li>
<li>Use trailing slashes if your app router is designed such way.</li>
<li>Also check the container port in your deployment YAML.</li>
</ol>
<p>Cheers</p>
