<p>I have an aks cluster deployed and assigned with an internal ip, but no external ip:</p>

<pre><code>NAME               TYPE           CLUSTER-IP    EXTERNAL-IP      PORT(S)        AGE
kubernetes         ClusterIP      10.0.0.1      &lt;none&gt;           443/TCP        11h
</code></pre>

<p>I may be going about this the wrong way, but the goal is to create the external endpoints for the cluster IP. Would the correct approach using the python SDK be creating a service load balancer? I have been unsuccessful finding the azure python SDK for that.
Some help, please. </p>

<p>My python function for creating the cluster:</p>

<pre><code>def create_cluster(node_count):
    cluster_resource = container_client.managed_clusters.create_or_update(
        resource_group,
        cluster_name,
        parameters=ManagedCluster(
            location='eastus',
            dns_prefix = dns_prefix,
            tags=None,
            service_principal_profile = self.service_principal_profile,
            agent_pool_profiles=[{
                'name': 'agentpool',
                'vm_size': 'Standard_DS2_v2',
                'count': 3,
            }],
        ),
    )
    return cluster_resource
</code></pre>

ghenzi83
<p>This is not really a right approach. Right approach is creating a kubernetes services of type LoadBalancer:</p>

<pre><code>kind: Service
apiVersion: v1
metadata:
  name: my-service
spec:
  selector:
    app: MyApp
  ports:
  - protocol: TCP
    port: 80
    targetPort: 9376
  type: LoadBalancer
</code></pre>

<p>that will create a load balancer and a public ip address for you. Topic is a bit complicated to just jump on it, but basically, kubernetes will managed those external endpoints for you, you only need to declare valid kubernetes primitives. You could precreate those, but it really makes no sense. Just let kubernetes do the hard work.</p>

<p>Reading:<br>
<a href="https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer</a></p>
