<p>We are using managed Kubernetes in Azure (AKS) and have run out of public IP addresses. We only need one, but AKS creates a new public IP every time we deploy a service and it does not delete it when the service is deleted. For example: </p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: somename
spec:
  ports:
  - port: 443
    targetPort: 443
  selector:
    app: somename
  # Also tried this to reuse public IP in AKS MC resource group
  # https://learn.microsoft.com/en-my/azure/aks/static-ip
  # loadBalancerIP: x.x.x.x
  type: LoadBalancer
</code></pre>

<p>Every time this is deployed (<code>kubectl create -f svc.yml</code>) a new public IP is created. When it is deleted (<code>kubectl delete -f svc.yml</code>) the IP remains. Trying to reuse one of the existing IPs with loadBalanceIP as in the comments above fails, "Public ip address ... is referenced by multiple ipconfigs in resource ...".</p>

<p>We have created a service request but it takes ages, so I'm hoping this will be faster. I don't dare to just delete the public IPs in the AKS managed resource as that may cause issues down the line.</p>

<p>Is there a way to safely release or reuse the public IPs? We are using Kubernetes version 1.7.12. We have deleted the deployment referenced by the service as well, it makes no difference.</p>

<p>It should delete the IPs after some time (like 5 minutes tops). So the issue you are having is a bug. You can check k8s events to find the error and look at it.</p>

<p>Also, its perfectly safe to delete Azure resources. k8s wont freak out if they are gone.</p>

<p>Tested with k8s 1.9.1</p>
