I have a Kubernetes Cluster with its VNet and in the Kubernetes Cluster VNet I have two (or more) subnets:
- aks-subnet with 10.224.0.0/16 where PODs are taking their IPs (default / created with cluster)
- vm subnet with 10.225.2.0/24 for having some virtual machines
In my case I am using azure-load-balancer-internal: ‘true’ annotation on the service of the pods to make their service visible in the same POD subnet 10.224.0.0/16. So a service “test” will get an ip into this subnet.
In the configmap “coredns-custom” I have specified a cluster resolution domain name as per documentation:
kind: ConfigMap
apiVersion: v1
metadata:
name: coredns-custom
namespace: kube-system
labels:
addonmanager.kubernetes.io/mode: EnsureExists
k8s-app: kube-dns
kubernetes.io/cluster-service: 'true'
data:
test.override: k8s_external aks-dataspace.local
Then apps in the same POD Subnet 10.224.0.0/16 can resolve other app services using aks-dataspace.local, for example by using FQDN: test.namespace.aks-dataspace.local but this does not work from another subnet.
What I tried is that from a VM from subnet 10.225.2.0/24 can resolve services from subnet 10.224.0.0/16 using IP Address but cannot resolve services using DNS (test.namespace.svc.cluster.local or test.namespace.aks-dataspace.local).
Any ideas?