<p>I have below config in my ingress service:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: nginx-ingress
  namespace: nginx-ingress
spec:
  externalTrafficPolicy: Local
  type: LoadBalancer
  loadBalancerIP: **.***.**.***
  ports:
  - port: 80
    targetPort: 80
    protocol: TCP
    name: http
  - port: 443
    targetPort: 443
    protocol: TCP
    name: https
  selector:
    app: nginx-ingress
</code></pre>

<p>we have purchased this public ip from azure. If we remove this loadBalancerIP from service yaml and deploy and then use the ip listed by <code>kubectl get services -n nginx-ingress</code>, It works fine when we access the service end points. But with this public ip nothing seems to be working.</p>

<p>Please find below service description (<code>kubectl describe service nginx-ingress -n nginx-ingress-os</code>):</p>

<pre><code>[openapianil@LHGOPENAPIDEV001 github]$ kubectl describe service nginx-ingress -n nginx-ingress-os
Name:                     nginx-ingress
Namespace:                nginx-ingress-os
Labels:                   &lt;none&gt;
Annotations:              kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"name":"nginx-ingress","namespace":"nginx-ingress-os"},"spec":{"externalTrafficPolicy"...
Selector:                 app=nginx-ingress
Type:                     LoadBalancer
IP:                       10.0.0.44
IP:                       **.**.**.***
LoadBalancer Ingress:     **.**.**.***
Port:                     http  80/TCP
TargetPort:               80/TCP
NodePort:                 http  31247/TCP
Endpoints:                **.**.**.***:80
Port:                     https  443/TCP
TargetPort:               443/TCP
NodePort:                 https  32241/TCP
Endpoints:                **.**.**.***:443
Session Affinity:         None
External Traffic Policy:  Local
HealthCheck NodePort:     30880
Events:
  Type    Reason                Age   From                Message
  ----    ------                ----  ----                -------
  Normal  EnsuringLoadBalancer  1m    service-controller  Ensuring load balancer
  Normal  EnsuredLoadBalancer   43s   service-controller  Ensured load balancer
</code></pre>

<p>Please help!!</p>

<p>As we know, after AKS created complete, Azure will create two resource groups.</p>

<p>If you want to create service with IP address, you should create static IP address in another resource group, name like <code>MC_myResourceGRoup_myAKSCluster_eastus</code>.</p>

<p>You can use Azure CLI command to create public IP address:</p>

<pre><code>az network public-ip create --resource-group MC_myResourceGRoup_myAKSCluster_eastus --name myAKSPublicIP --allocation-method static
</code></pre>

<p>Also you can use Azure portal to create it, but you <strong>can't</strong> add DNS to it.</p>

<p>Then you can use static IP address like this:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: azure-vote-front1
spec:
  type: LoadBalancer
  loadBalancerIP: 52.224.235.119
  ports:
  - port: 80
  selector:
    app: azure-vote-front1
</code></pre>

<p>Here is the result:</p>

<p><a href="https://i.stack.imgur.com/W7Z01.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W7Z01.png" alt="enter image description here"></a></p>

<p><strong>Note:</strong></p>

<p>1.Create Azure public IP address <strong>without</strong> DNS name.<br>
2.Create Azure public IP address in this resource group <code>MC_myResourceGRoup_myAKSCluster_eastus</code>.<br>
3.You can use <code>kubectl describe service</code> to check the status, like this:</p>

<pre><code>[root@jasoncli@jasonye jason]# kubectl describe service azure-vote-front1
Name:                     azure-vote-front1
Namespace:                default
Labels:                   &lt;none&gt;
Annotations:              &lt;none&gt;
Selector:                 app=azure-vote-front1
Type:                     LoadBalancer
IP:                       10.0.76.241
IP:                       52.224.235.119
LoadBalancer Ingress:     52.224.235.119
Port:                     &lt;unset&gt;  80/TCP
TargetPort:               80/TCP
NodePort:                 &lt;unset&gt;  30416/TCP
Endpoints:                10.244.0.11:80
Session Affinity:         None
External Traffic Policy:  Cluster
Events:
  Type    Reason                Age   From                Message
  ----    ------                ----  ----                -------
  Normal  CreatingLoadBalancer  45m   service-controller  Creating load balancer
  Normal  CreatedLoadBalancer   44m   service-controller  Created load balancer
</code></pre>

<p><strong>Update:</strong></p>

<p>Here is my yaml file:</p>

<pre><code>apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: azure-vote-back
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: azure-vote-back
    spec:
      containers:
      - name: azure-vote-back
        image: redis
        ports:
        - containerPort: 6379
          name: redis
---
apiVersion: v1
kind: Service
metadata:
  name: azure-vote-back
spec:
  ports:
  - port: 6379
  selector:
    app: azure-vote-back
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: azure-vote-front
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: azure-vote-front
    spec:
      containers:
      - name: azure-vote-front
image: microsoft/azure-vote-front:v1
        ports:
        - containerPort: 80
        env:
        - name: REDIS
          value: "azure-vote-back"
---
apiVersion: v1
kind: Service
metadata:
  name: azure-vote-front
spec:
  loadBalancerIP: 40.71.3.119
  type: LoadBalancer
  ports:
  - port: 80
  selector:
    app: azure-vote-front
</code></pre>
