<p>When I create a GCE ingress, Google Load Balancer does not set the health check from the readiness probe. According to the docs (<a href="https://github.com/kubernetes/ingress-gce#health-checks" rel="noreferrer">Ingress GCE health checks</a>) it should pick it up.</p>

<blockquote>
  <p>Expose an arbitrary URL as a readiness probe on the pods backing the Service.</p>
</blockquote>

<p>Any ideas why?</p>

<p>Deployment:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: frontend-prod
  labels:
    app: frontend-prod
spec:
  selector:
    matchLabels:
      app: frontend-prod
  replicas: 3
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: frontend-prod
    spec:
      imagePullSecrets:
        - name: regcred
      containers:
      - image: app:latest
        readinessProbe:
          httpGet:
            path: /healthcheck
            port: 3000
          initialDelaySeconds: 15
          periodSeconds: 5
        name: frontend-prod-app
      - env:
        - name: PASSWORD_PROTECT
          value: "1"
        image: nginx:latest
        readinessProbe:
          httpGet:
            path: /health
            port: 80
          initialDelaySeconds: 5
          periodSeconds: 5
        name: frontend-prod-nginx
</code></pre>

<hr>

<p>Service:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: frontend-prod
  labels:
    app: frontend-prod
spec:
  type: NodePort
  ports:
  - port: 80
    targetPort: 80
    protocol: TCP
    name: http
  selector:
    app: frontend-prod
</code></pre>

<hr>

<p>Ingress:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: frontend-prod-ingress
  annotations:
    kubernetes.io/ingress.global-static-ip-name: frontend-prod-ip
spec:
  tls:
    - secretName: testsecret
  backend:
    serviceName: frontend-prod
    servicePort: 80
</code></pre>

<p>So apparently, you need to include the container port on the PodSpec.
Does not seem to be documented anywhere.</p>
<p>e.g.</p>
<pre><code>    spec:
      containers:
      - name: nginx
        image: nginx:1.7.9
        ports:
        - containerPort: 80
</code></pre>
<p>Thanks, Brian! <a href="https://github.com/kubernetes/ingress-gce/issues/241" rel="nofollow noreferrer">https://github.com/kubernetes/ingress-gce/issues/241</a></p>
