[Yandex Cloud documentation](../../index.md) > [Yandex Network Load Balancer](../index.md) > [Concepts](index.md) > Use cases

# Network load balancer use cases


## VMs {#nlb-vm}

The figure below shows an example of using a network load balancer with individual [VMs](../../compute/concepts/vm.md).

![NLB-VM](../../_assets/network-load-balancer/nlb-vm.svg)

A load balancer’s incoming traffic is distributed in a certain way among VMs located in the target groups downstream of the load balancer.

If multiple traffic listeners are used on one load balancer, the traffic coming to these listeners will be distributed among all target groups connected to this load balancer simultaneously.

For example, traffic coming to "Listener-1" will be sent to instances in target groups 1 and 2.

For more granular traffic listening, instead of creating multiple listeners per load balancer, we recommend creating a separate load balancer for each service.


### Use cases {#examples-vm}

* [Architecture and protection of a basic web service](../tutorials/web-service.md)
* [Deploying Microsoft Exchange](../tutorials/exchange.md)
* [Migrating services from an NLB to an L7 ALB to enable Yandex Smart Web Security protection](../tutorials/migration-from-nlb-to-alb/index.md)


## Instance group {#nlb-ig}

The figure below shows an example of using a network load balancer with an [instance group](../../compute/concepts/instance-groups/index.md).

![NLB-IG](../../_assets/network-load-balancer/nlb-ig.svg)

When creating an instance group, a target group for the network load balancer will also be created, which will include all VMs from this group.

When adding or removing VMs from the group, the load balancer's target group will also reflect these changes.

[Example](../tutorials/vm-autoscale/index.md) of deploying an instance group with autoscaling and integration with a network load balancer.

### Use cases {#examples-ig}

* [Configuring a fault-tolerant architecture in Yandex Cloud](../tutorials/fault-tolerance.md)
* [Updating an instance group under load](../tutorials/updating-under-load.md)
* [Deploying Microsoft Exchange](../tutorials/exchange.md)
* [Deploying an Always On availability group with an internal network load balancer](../tutorials/mssql-alwayson-lb.md)
* [Migrating services from an NLB to an L7 ALB to enable Yandex Smart Web Security protection](../tutorials/migration-from-nlb-to-alb/index.md)


## Managed Service for Kubernetes cluster {#nlb-mk8s}

The figure below shows an example of using a network load balancer with [Managed Service for Kubernetes](../../managed-kubernetes/concepts/index.md).

![NLB-MK8S](../../_assets/network-load-balancer/nlb-mk8s.svg)

To use a network load balancer as part of services within a Managed Service for Kubernetes cluster, you need to create a service of the `LoadBalancer` type. Then the cluster itself will create network load balancer objects according to the provided manifests and will monitor the load balancer's target group receiving VMs from all node groups of that cluster.

{% note warning %}

Do not modify or delete the network load balancer and target groups automatically created in your folder via the Yandex Cloud interfaces (the management console, Terraform, CLI, or API). This may cause incorrect operation of the Managed Service for Kubernetes cluster.

{% endnote %}

To learn more about deploying a service using a network load balancer in a Kubernetes cluster, see [Granting access to an app running in a Kubernetes cluster](../../managed-kubernetes/operations/create-load-balancer.md).


### Use cases {#examples-mk8s}

* [Migrating services from an NLB with a Yandex Managed Service for Kubernetes cluster as a target to an L7 ALB](../tutorials/migration-from-nlb-to-alb/nlb-with-target-resource-k8s/index.md)