Securing Kubernetes API on Azure only accessible by Local IP (RFC1918)

1/11/2020

Notice that when I create a Azure Kubernetes, by default it creates the API with an *.azmk8s.io FQDN and it is external facing. Is there a way to create with local IP instead? If "yes", can this be protected by NSG and Virtual Network to limit connections coming via Jump Server? If there is any drawback creating to only allow internal IP?

Below is the command I used to create:-

az aks create -g [resourceGroup] -n [ClusterName]  --windows-admin-password [SomePassword] --windows-admin-username [SomeUserName] --location [Location] --generate-ssh-keys -c 1 --enable-vmss --kubernetes-version 1.14.8 --network-plugin azure

Anyone tried https://docs.microsoft.com/en-us/azure/aks/private-clusters? If that still allows external facing app but private management API?

-- Adi Wong
azure
azure-kubernetes
azure-virtual-network
kubernetes

1 Answer

1/11/2020

why not? only the control plane endpoint is different. in all other regards - its a regular AKS cluster.

In a private cluster, the control plane or API server has internal IP addresses that are defined in the RFC1918 - Address Allocation for Private Internets document. By using a private cluster, you can ensure that network traffic between your API server and your node pools remains on the private network only.

this outlines how to connect to private cluster with kubectl. NSG should work as usual

-- 4c74356b41
Source: StackOverflow