<p>I have a deployement on google cloud kubernetes engine</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: graph-service-2-deployment
  labels:
    app: graph-service-2
spec:
  replicas: 1
  selector:
    matchLabels:
      app: graph-service-2
      tier: web
  template:
    metadata:
      labels:
        app: graph-service-2
        tier: web
    spec:
      containers:
        - name: graph-service-container
          image: gcr.io/myimage:latest
          ports:
            - containerPort: 8080
          resources:
            limits:
              cpu: 1000m
              memory: 2Gi
              ephemeral-storage: 4Gi
            requests:
              cpu: 500m
              memory: 512Mi
              ephemeral-storage: 1Gi
</code></pre>
<p>I am trying to expose this deployement using Service:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: graph-service-2-service
  labels:
    app: graph-service-2
spec:
  type: LoadBalancer
  loadBalancerIP: 35.212.191.164
  selector:
    app: graph-service-2
    tier: web
  ports:
    - port: 80
      targetPort: 8080
</code></pre>
<p>My App listens on 8080.</p>
<p>How I reserved the ip:</p>
<p><code>gcloud compute addresses create graph-service-2-ip --region us-west1 --network-tier=STANDARD</code></p>
<p><code>gcloud compute addresses describe graph-service-2-ip --region us-west1</code></p>
<p>I apply the configurations</p>
<p><code>kubectl apply -f service</code></p>
<p><code>kubectl apply -f deployment</code></p>
<p>The deployment comes up ok.</p>
<p>I can see my Ip Adresss in Google Cloud VPC Ip Adresses UI, interestingly it says it is not in use:
<a href="https://i.stack.imgur.com/c0xyC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c0xyC.png" alt="enter image description here" /></a></p>
<p>Expectation:
Go to the reserved external IP from my web browser and communicate with my app over http.</p>
<p>Actual:
I go to my reserved IP address from my web browser and I am met with the following error page:
<a href="https://i.stack.imgur.com/aBqkG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aBqkG.png" alt="enter image description here" /></a>
This page didn't send any data.</p>
<p>I also followed google's guide <a href="https://cloud.google.com/kubernetes-engine/docs/tutorials/configuring-domain-name-static-ip#step_2b_using_an_ingress" rel="nofollow noreferrer">here</a> and tried many variations of what they suggested.</p>
<p><strong>If I create and expose a service via the ui with the same port forwarding rules, it works just fine</strong> and I am able to access my app.</p>
<p>Please let me know why I cannot access my application using my reserved IP.
If you also have any suggestions on how I can improve my setup in other ways I would be happy to hear them.</p>

Hassu
<p>Looks like the static IP you reserved uses the standard network tier.<br />
You'll need to add the following annotation to your service spec:</p>
<pre><code>cloud.google.com/network-tier: Standard
</code></pre>
<p>Something like</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: graph-service-2-service
  labels:
    app: graph-service-2
  annotations:
    cloud.google.com/network-tier: Standard
...
</code></pre>
<p>Note:  You can find all the possible parameters <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/service-load-balancer-parameters" rel="nofollow noreferrer">here</a></p>
