azurekubernetesvnet

Contact Service IP from Integrated VNET between WebApp and Kubernetes Cluster


I have an Azure WebApp with its VNet and a Kubernetes Cluster with its VNet.

In the Kubernetes Cluster VNet I have three subnets:

  1. aks-subnet with 10.224.0.0/16 where PODs are taking their IPs (default / created with cluster)
  2. app-subnet with 10.225.1.0/24 for integration with WebApp Services
  3. pbi subnet with 10.225.2.0/24 for integration with PowerBI Virtual Gateways

I also have integrated WebApp VNet with Kubernetes VNet enter image description here

Using the webapp I can contact with POD IPs of the cluster but I cannot contact with Service IPs or Service private FQDN of the cluster.

I also noticed that address space and subnet for services isn't created by default with the cluster creation. ![enter image description here

Any ideas why and how I can fix this?


Solution

  • The solution on this is to use Service Type of Load Balancer but with the annotation of "internal-load-balancer"

    metadata:
      annotations:
        service.beta.kubernetes.io/azure-load-balancer-internal: true
    

    This is going to provision an internal load-balancer with IP inside the POD's subnets (and will be assigned to service external ip) which will be later accessibly from the two other subnets.