Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to: AKS on Windows Server
This article describes how to create and use a custom load balancer. In Azure Kubernetes Service (AKS) on Windows Server, you can use load balancers to send requests to the Kubernetes API server and to manage traffic to application services. When you use a custom load balancer, kube-vip automatically deploys to manage the load balancing of requests to the Kubernetes API server and to make sure that it's highly available.
Note
You can also use a other load balancers, such as MetalLB or Software Defined Networking (SDN) load balancing, to load balance traffic to application services.
Before you begin
You must install AKS on Windows Server and provide a range of virtual IP addresses for the load balancer during the network configuration step during installation.
Configure a custom load balancer
Warning
If you choose to deploy your own load balancer, the Kubernetes cluster becomes unreachable after installation. If you deploy any services with type=LoadBalancer
, the services are also unreachable until you configure your load balancer.
This configuration assumes you want to use a custom load balancer in your cluster. In this case, the workload cluster is deployed without a load balancer:
Create a load balancer configuration using the New-AksHciLoadBalancerSetting cmdlet and then select
none
for theloadBalancerSku
parameter:$lbCfg=New-AksHciLoadBalancerSetting -name "myLb" -loadBalancerSku "none"
Deploy a workload cluster without providing the load balancer configuration using the following command:
New-AksHciCluster -name "summertime" -nodePoolName mynodepool -nodeCount 2 -OSType linux -nodeVmSize Standard_A4_v2 -loadBalancerSettings $lbCfg
Use Get-AksHciCluster to verify that the cluster is successfully deployed with the control plane nodes running
kube-vip
and that the API server requests are reachable.Manually configure your load balancer.
If you run an upgrade, the load balancer configuration (loadBalancerSku
and count
) you defined during installation remains the same after the upgrade completes. However, if you want to update loadBalancerSku
during an upgrade, you must redeploy your workload clusters. If you have existing clusters running a HAProxy-based load balancer, you can continue running your workloads. The upgrade then completes successfully.
Important
If you change from using a custom load balancer to using the default load balancer, you're required to redeploy your workload cluster with the new load balancer configuration. For information about how to configure the default load balancer, see Configure load balancer.
Next steps
To learn more about Kubernetes services, see the Kubernetes services documentation.