title: assign static IP to LoadBalancer service using k8s on aws
body: <p>Objective: create a k8s LoadBalancer service on AWS whose IP is static</p>
  
  <p>I have no problem accomplishing this on GKE by pre-allocating a static IP and passing it in via <code>loadBalancerIP</code> attribute:</p>
  
  <pre><code>$ kubectl apply -f - &lt;&lt;EOF
  apiVersion: v1
  kind: Service
  metadata:
    name: dave
  loadBalancerIP: 17.18.19.20
  ...etc...
  </code></pre>
  
  <p>But doing same in AWS results in <code>externalIP</code> stuck as <code>&lt;pending&gt;</code> and an error in the <code>Events</code> history</p>
  
  <p>Removing the <code>loadBalancerIP</code> value allows k8s to spin up a Classic LB:</p>
  
  <pre><code>$ kubectl describe svc dave
  Type:                   LoadBalancer
  IP:                     100.66.51.123
  LoadBalancer Ingress:   ade4d764eb6d511e7b27a06dfab75bc7-1387147973.us-west-2.elb.amazonaws.com
  ...etc...
  </code></pre>
  
  <p>but AWS explicitly warns me that the IPs are ephemeral (there's sometimes 2), and Classic IPs don't seem to support attaching static IPs</p>
  
  <p>Thanks for your time</p>