Installing the Application Load Balancer Ingress controller
To balance the load and distribute traffic between Kubernetes applications, you can use an Yandex Application Load Balancer Ingress Controller. It will launch the L7 load balancer and its auxiliary resources when you create an Ingress
resource in a Managed Service for Kubernetes cluster.
Getting started
-
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder specified when creating the CLI profile is used by default. To change the default folder, use the
yc config set folder-id <folder_ID>
command. You can specify a different folder using the--folder-name
or--folder-id
parameter. -
Make sure that the security groups for the Managed Service for Kubernetes cluster and its node groups are configured correctly. If any rule is missing, add it.
Make sure you have configured Application Load Balancer security groups.
Warning
The configuration of security groups determines the performance and availability of the cluster and the services and applications running in it.
-
Create an Ingress Controller service account and assign it the following roles for the folder:
- alb.editor: To create the Application Load Balancer resources.
- vpc.publicAdmin: To manage external network connectivity.
- certificate-manager.certificates.downloader: To use certificates registered in Yandex Certificate Manager.
- compute.viewer: To use Managed Service for Kubernetes cluster nodes in the L7 load balancer target groups.
- smart-web-security.editor: To connect your Yandex Smart Web Security security profile to the L7 load balancer virtual host. This is an optional setting.
-
Create a service account authorized access key in JSON format and save it to the
sa-key.json
file:yc iam key create \ --service-account-name <name_of_service_account_for_Ingress_controller> \ --output sa-key.json
Installation using Yandex Cloud Marketplace
-
Navigate to the folder dashboard and select Managed Service for Kubernetes.
-
Click the name of the cluster you need and select the
Marketplace tab. -
Under Application available for installation, select ALB Ingress Controller and click Go to install.
-
Configure the application:
-
Namespace: Create a new namespace, e.g.,
alb-ingress-controller-space
. If you leave the default namespace, ALB Ingress Controller may work incorrectly. -
Application name: Specify the application name.
-
Folder ID: Specify the folder ID.
-
Cluster ID: Specify the cluster ID.
-
Service account key: Paste the contents of the
sa-key.json
file. -
Enable default health checks: Select this option to install DaemonSet
in the node group network for application health checks.DaemonSet adds pods with traffic monitoring agents to each node. As a result, node and namespace isolation does not affect monitoring process, which means you get accurate traffic monitoring data. If the number of cluster nodes increases or decreases, DaemonSet adds or removes monitoring agents, respectively.
You can skip this option if you do not need to run cluster health checks or if you are using your own health check solution. For more information on configuring health checks manually, see Health checking your apps in a Yandex Managed Service for Kubernetes cluster using a Yandex Application Load Balancer L7 load balancer.
-
-
Click Install.
-
Wait for the application to change its status to
Deployed
.
Installation using a Helm chart
-
Install Helm
v3.8.0 or higher. -
Install kubect
and configure it to work with the new cluster. -
Install
jq
for stream processing of JSON files:sudo apt update && sudo apt install jq
-
To install the Helm chart
with the Ingress Controller, run this command:cat sa-key.json | helm registry login cr.yandex --username 'json_key' --password-stdin && \ helm pull oci://cr.yandex/yc-marketplace/yandex-cloud/yc-alb-ingress/yc-alb-ingress-controller-chart \ --version v0.2.23 \ --untar && \ helm install \ --namespace <namespace> \ --create-namespace \ --set folderId=<folder_ID> \ --set clusterId=<cluster_ID> \ --set enableDefaultHealthChecks=<true_or_false> \ --set-file saKeySecretKey=sa-key.json \ yc-alb-ingress-controller ./yc-alb-ingress-controller-chart/
Note
If you are using a Helm version below 3.8.0, append the
export HELM_EXPERIMENTAL_OCI=1 && \
string to the command to enable Open Container Initiative (OCI) support in the Helm client.If you set
namespace
to the default namespace, ALB Ingress Controller may work incorrectly. We recommend you to specify a value different from all existing namespaces (e.g.,alb-ingress-controller-space
).The
enableDefaultHealthChecks
option enables application health checks in a cluster. With this option selected, ALB Ingress Controller installs DaemonSet in the node group network.DaemonSet adds pods with traffic monitoring agents to each node. As a result, node and namespace isolation does not affect monitoring process, which means you get accurate traffic monitoring data. If the number of cluster nodes increases or decreases, DaemonSet adds or removes monitoring agents, respectively.
You can skip this option if you do not need to run cluster health checks or if you are using your own health check solution. For more information on configuring health checks manually, see Health checking your apps in a Yandex Managed Service for Kubernetes cluster using a Yandex Application Load Balancer L7 load balancer.
Use cases
- Application Load Balancer Ingress Controller configuration tutorial.
- Application Load Balancer Ingress Controller logging configuration tutorial.
See also
- Ingress controller official documentation description.
- Restrictions when updating ALB Ingress Controller.