How to publish services on AKS with Nodeport service type

Suneetha Busi 1 Reputation point
2020-12-16T09:02:23.257+00:00

I want to access my services via Nodeport service type. Could you kindly confirm if it is feasible? From https://github.com/Azure/AKS/issues/518 I do see exposing service via Nodeport is not feasible yet, So I consider maybe it is not up to date. Please confirm if that is possible.

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
1,855 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. KarishmaTiwari-MSFT 18,367 Reputation points Microsoft Employee
    2020-12-23T01:42:44.477+00:00

    NodePort services are a standard Kubernetes feature and well-supported on AKS.

    The linked issue requests NodePort services with Public IPs. By default nodes in AKS have only private IPs so NodePort services will not be reachable from outside the cluster.

    AKS supports public IP per VM now: https://learn.microsoft.com/en-us/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools-preview

    This appears to work with NodePort services on some basic testing, which seems consistent to me (guess the node listens on all addresses). You would need to adjust the NSG to allow all the NodePorts you want to use, though.

    The linked github issue also mentions about trying HA proxy load balancing connections, which is exactly what an ingress controller would do.

    Another point to add is that a service of type 'LoadBalancer' already uses NodePorts to function. You can see the NodePort if you list services or run 'kubectl get svc <svcname>|grep NodePort'.
    The NodePort is what the Azure Load Balancer uses as it is distributing traffic across the nodes.

    Please provide details on why you are interested in using NodePort vs load balancer (less complexity), so that we can help further.

    1 person found this answer helpful.
    0 comments No comments

  2. Suneetha Busi 1 Reputation point
    2020-12-17T11:53:24.417+00:00

    Can I have an update