<p>My workflow is something on the lines of:</p>

<ol>
<li>Create a static Public IP on Azure and map it to a DNS name.</li>
<li>Then start a service in Kubernetes which spins up a an LB to which we attached the pre-reserved public IP.</li>
</ol>

<p>Approach 1:</p>

<pre><code>externalName: &lt;FQDN&gt;
</code></pre>

<p>Approach 2:</p>

<pre><code>type: LoadBalancer
externalIPs:
- 52.232.30.160
</code></pre>

<p>Approach 3:</p>

<pre><code>type: LoadBalancer
loadBalancerIP: 52.232.30.160
</code></pre>

<p>Approach 4:</p>

<pre><code>type: LoadBalancer
clusterIP: 52.166.121.161
</code></pre>

<p>But none of them seems to work. The LB always gets 2 public IPs - one statically assigned and the other dynamically assigned.</p>

<p>I was wondering what is the right way to do this and if Azure supports assignment of public IPs to the LB.</p>

<p>try this:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  labels:
    run: my-nginx
  name: my-nginx
  namespace: default
spec:
  clusterIP: $clusterip
  loadBalancerIP: $externalip
  ports:
  - port: 80
    protocol: TCP
    targetPort: 80
  selector:
    run: my-nginx
  sessionAffinity: None
  type: LoadBalancer
</code></pre>

<p>available external addresses check in fronted ip configuration of azure load balancer (but not masters)</p>
