Hello @SajanSS-1385 ,
Regarding "As my AKS subnet is /22 , is it okay to use a service CIDR of /23 or /24 ?"
You can definitely use that range but not a recommended option, Just make sure that this address must not overlap with any subnet IP ranges used in the cluster subnet parameter. Kubernetes Service Range cannot be in the same subnet as the AKS Cluster. Basically as you know Kubernetes service address range is a set of virtual IPs that Kubernetes assigns to internal
services in your cluster. You can use any private address range to satisfy the IPAddress range . K8s service range is not a routable range and only K8s knows about it, routing packets from containers to a service within the cluster . Please make a note that , this range should not be used by any network element on or connected to this virtual network. Service address CIDR must be smaller than /12
What should be Docket bridge IP range , can we use a smaller rage like /24 ?
*Yes - you can use the smaller range. When you try creating this Docker Bridge IP range using azure portal , it will use a default range like 172.17.0.1/16 for docker network (You can use /24 too) . I would suggest go with the default one. Basically this is the address space for docker bridge networking which will be used for docker build etc. (Not used by AKS cluster or PODS) You should definitely pick up and address space which will not conflict with other spaces. Mainly this range lets the AKS nodes communicate with the underlying management platform *
If reuse service CIDR and Docker bridge and across environments can it create problem in future ? , event though Microsoft link says you should not reuse these , additional address space for these is not easy as it sounds
Service CIDR and Docker CIDR can be definitely re-used with out any issue . For example if you have Prod/Test/Integration environment - you can re-use same service CIDR across all those environments . Recommendation is to use unique CIDR across different environments
Additional references:-
- https://learn.microsoft.com/en-us/azure/aks/configure-azure-cni#plan-ip-addressing-for-your-cluster
- https://learn.microsoft.com/en-us/azure/aks/configure-kubenet#:~:text=The%20%2D%2Ddocker%2Dbridge%2Daddress,in%20use%20on%20your%20network.
- https://learn.microsoft.com/en-us/azure/aks/configure-azure-cni
- https://learn.microsoft.com/en-us/answers/questions/124451/azure-cni-service-cidr-and-docker-bridge-cidr.html
Hope it helps! Please make sure to Accept As Answer if it has helped you out so that it can be useful to the community out there.