Secure AKS cluster

Secure AKS cluster

When we create a Kubernetes cluster, by default the API server which expose the Kubernetes functionality is assigned a public IP. The communication between the API server and nodes is through public network. The access is controlled using the RBAC and also we can enable secure access by enabling the authorized IP ranges which allows the communication to take place from a particular set of IP ranges defined.

 When we create a private AKS cluster, the communication between the API server and nodes remain in the private network. The API server is exposed as a Azure private link service using a private end point and the services is accessed by the nodes privately from their VNETs. More details can be found here. We can create a more secure AKS cluster using this approach.

Let's looks at the resource created for the private AKS cluster. The recommended way of creating the private cluster is to have hub-spoke topology. Since the AKS cluster is accessible only through private IP, we need to have a following components to access a AKS cluster

  • A jump server or VM to access the AKS cluster
  • Azure firewall - This will allow AKS cluster to access the whitelisted network and applications from the internet. More details can be found here.

These resources are provisioned in the hub VNET.

No alt text provided for this image

 The firewall will have a public IP address and a private IP address as shown.

No alt text provided for this image

The firewall settings with the network rules is shown below. One of the rule can be Azure container registry service tag which will allow access to docker images.

No alt text provided for this image

The firewall settings with the application rules will be as shown. One of the rule is to allow access to OS updates.

No alt text provided for this image

The hub will also have a UDR which will route all traffic originating from the AKS cluster to private IP of the firewall as shown.

No alt text provided for this image

AKS cluster will be created in the spoke VNET as shown below. 

No alt text provided for this image

When we create a private cluster, the kube-apiserver will be exposed as a private end point with a network interface attached and also a private DNS zone will be created. 

No alt text provided for this image

The private DNS will have A record which will point to the private IP of the API server.

No alt text provided for this image

The AKS VNET which is part of the spoke will be added to the virtual network links automatically as shown below. We need to add the hub VNET to the virtual network links which will perform the DNS resolution from the jump server.

No alt text provided for this image

We also need to connect the hub and spoke VNET using the peering as shown.

No alt text provided for this image

We can verify the DNS resolution from the jump server VM as follows.

No alt text provided for this image

These configuration works when you are using the azure provided DNS by default. In case if you are using a custom DNS server or trying to connect from an on-premise server, the DNS resolution will not work. In such scenarios, you might need to create a VM as a DNS resolver to the Azure IP address 168.63.129.16 and set the conditional forwarder and then link the VM VNET in the private DNS zone.

要查看或添加评论,请登录

Girish Goudar的更多文章

  • GitOps - Part 2

    GitOps - Part 2

    In the previous post, we looked at how to use fluxv2 for deploying apps through helm and kustomization. In this we will…

    2 条评论
  • Service Mesh - Istio Part 3

    Service Mesh - Istio Part 3

    Modern applications and platforms are distributed and deployed across data center, cloud and edge. Service mesh…

    1 条评论
  • Azure Arc- Data services

    Azure Arc- Data services

    Azure Arc enable to us manage VM's, Kubernetes, SQL and Data services of Azure deployed to any cloud or data center in…

  • Cert-Manager - Part 1

    Cert-Manager - Part 1

    Cert-manager automates the management of certificates within Kubernetes. It can be integrated with existing…

  • Kubernetes Policy - Open Policy Agent

    Kubernetes Policy - Open Policy Agent

    Open Policy Agent(OPA) is a general purpose declaratively policy engine which can be used for applying policy across…

  • GitOps - Part 1

    GitOps - Part 1

    GitOps provides a way to declare the state of the cluster as code and make it so. This ensures that there is no drift…

  • Service Mesh - Istio Part 2

    Service Mesh - Istio Part 2

    In the previous post, we looked at traffic management feature of istio . In this article we will take a brief look at…

  • Cluster API - Azure

    Cluster API - Azure

    This tool provides a consistent way of creating the kubernetes cluster across bare metal,onprem and various cloud…

  • Service Mesh - Istio Part 1

    Service Mesh - Istio Part 1

    In this series of article, we will look at service mesh and what are the problems they solve. There are lot of service…

  • Kustomizing your deployments

    Kustomizing your deployments

    Helm, the package manager for kubernetes is a great tool for deploying applications . It provides the templating…

社区洞察

其他会员也浏览了