title: Set static external IP for my load balancer on GKE
body: <p>I am trying to set up a static external IP for my load balancer on GKE but having no luck. Here is my Kubernetes service config file: </p>
  
  <pre><code>kind: Service
  apiVersion: v1
  metadata:
    name: myAppService
  spec:
    selector:
      app: myApp
    ports:
    - protocol: TCP
      port: 3001
      targetPort: 3001
    type: LoadBalancer
    loadBalancerIP: *********
  </code></pre>
  
  <p>This doesn't work. I expect to see my external IP as ********* but it just says pending: </p>
  
  <pre><code>➜  git:(master) kubectl get services
  NAME         CLUSTER-IP    EXTERNAL-IP   PORT(S)          AGE
  kubernetes   *********    &lt;none&gt;        443/TCP          5m
  myAppService   *********   &lt;pending&gt;     3001:30126/TCP   5m
  </code></pre>
  
  <p>More details:   </p>
  
  <pre><code>➜  git:(master) kubectl describe services
  Name:           kubernetes
  Namespace:      default
  Labels:         component=apiserver
              provider=kubernetes
  Annotations:        &lt;none&gt;
  Selector:       &lt;none&gt;
  Type:           ClusterIP
  IP:         *********
  Port:           https   443/TCP
  Endpoints:      *********
  Session Affinity:   ClientIP
  Events:         &lt;none&gt;
  
  
  Name:           myAppService
  Namespace:      default
  Labels:         &lt;none&gt;
  Annotations:        &lt;none&gt;
  Selector:       app=myApp
  Type:           LoadBalancer
  IP:         *********
  Port:           &lt;unset&gt; 3001/TCP
  NodePort:       &lt;unset&gt; 30126/TCP
  Endpoints:
  Session Affinity:   None
  Events:
    FirstSeen LastSeen    Count   From            SubObjectPath   Type        Reason              Message
    --------- --------    -----   ----            -------------   --------    ------              -------
    5m        20s     7   service-controller          Normal      CreatingLoadBalancer        Creating load balancer
    5m        19s     7   service-controller          Warning     CreatingLoadBalancerFailed  Error creating load balancer (will retry): Failed to create load balancer for service default/myAppService: Cannot EnsureLoadBalancer() with no hosts
  </code></pre>
  
  <p>Any ideas?</p>