---
title: "Ingress and Ingress Controller"
sidebar_label: "Ingress and Ingress Controller"
sidebar_position: 1
description: "What Ingress and Ingress Controller are, how to install an Ingress Controller, and how to create an Ingress"
---

import Formbricks from '@theme/MDXComponents/Formbricks'
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import {TabItemLabel} from '@selectel/docux/components'

# Ingress and Ingress Controller

[Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/) is a Kubernetes object that defines rules for external traffic routing, load balancing, and SSL termination. An [Ingress Controller](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/) is a proxy server in a Managed Kubernetes cluster that routes traffic based on rules defined in Ingress.

In Managed Kubernetes, the Ingress Controller is not preinstalled in the cluster; you must install it manually. The choice of controller depends on the requirements of applications hosted in the Managed Kubernetes cluster. You can view the list of available controllers in the [Ingress Controllers](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/#additional-controllers) guide in the Kubernetes documentation. For example, you can [install the Traefik Ingress Controller](#install-ingress-controller).

After installing the Ingress Controller, [create an Ingress](#create-ingress).

![](https://423.selcdn.ru/kb/mks-set-up-ingress-LANG-THEME.png)

## Install Traefik Ingress Controller \{#install-ingress-controller}

Along with the Ingress Controller, a load balancer will be automatically created with the following parameters:

* IP address — public;
* [type](/cloud-servers/load-balancers/about-load-balancers.mdx#balancer-types) — Basic with redundancy;
* protocol — TCP.

You can select the load balancer type and configure other parameters for it — learn more about load balancer parameters in the [Configure a load balancer](/managed-kubernetes/networks/loadbalancing-with-ingress/load-balancers.mdx) guide.

The load balancer will serve as the entry point for accessing applications in the cluster, so you do not need to create an internal load balancer additionally.

<Tabs queryString="install-ingress-controller">
  <TabItem value="without-configuring-loadbalancer" default>
    <TabItemLabel>
      Without configuring a load balancer
    </TabItemLabel>

    1. Make sure that the pool has an allocated [quota](/access-control/projects/quotas.mdx) for at least one public floating IP address.

    2. [Connect to the cluster](/managed-kubernetes/clusters/connect-to-cluster.mdx).

    3. Install the [Helm](https://helm.sh/docs/intro/install/) package manager.

    4. Add the `traefik` repository to Helm:

       ```bash
       helm repo add traefik https://traefik.github.io/charts
       ```

    5. Update the repository list:

       ```bash
       helm repo update
       ```

    6. Install the Ingress Controller:

       ```bash
       helm install traefik traefik/traefik
       ```

    7. Ensure the Ingress Controller is installed:

       ```bash
       kubectl get pods
       ```

       Information about the Ingress Controller will appear in the response. For example:

       ```bash
       NAME                       READY   STATUS    RESTARTS   AGE
       traefik-78d5c6f95b-2xk9p   1/1     Running   0          51s
       ```

       A new load balancer will be created. It will appear in the [control panel](https://my.selectel.ru/vpc/default/lbaas/load-balancers/): in the top menu, click **Products** and select **Cloud Servers** → **Load Balancers** section → **Load Balancers** tab.
  </TabItem>

  <TabItem value="with-configuring-loadbalancer">
    <TabItemLabel>
      With load balancer configuration
    </TabItemLabel>

    1. Make sure that the pool has an allocated [quota](/access-control/projects/quotas.mdx) for at least one public floating IP address.

    2. [Connect to the cluster](/managed-kubernetes/clusters/connect-to-cluster.mdx).

    3. Install the [Helm](https://helm.sh/docs/intro/install/) package manager.

    4. Add the `traefik` repository to Helm:

       ```bash
       helm repo add traefik https://traefik.github.io/charts
       ```

    5. Get the default values for the `traefik/traefik` Helm chart and save them to a `values.yaml` file:

       ```bash
       helm inspect values traefik/traefik > values.yaml
       ```

    6. In the `annotations` block of the `values.yaml` file, add the required parameters for the load balancer — learn more about load balancer parameters in the [Configure a load balancer](/managed-kubernetes/networks/loadbalancing-with-ingress/load-balancers.mdx) guide.

       For example, if the load balancer needs an allocated private IP address instead of the default public IP address, add the `service.beta.kubernetes.io/openstack-internal-load-balancer: "true"` annotation.

       Manifest fragment with the `annotations` block:

       ```yaml
       apiVersion: v1
       kind: Service
       metadata:
         annotations:
           meta.helm.sh/release-name: traefik
           meta.helm.sh/release-namespace: default
           service.beta.kubernetes.io/openstack-internal-load-balancer: "true"
       ```

    7. Save the changes.

    8. Install the Traefik Ingress Controller:

       ```bash
       helm install traefik traefik/traefik --generate-name -f values.yaml
       ```

    9. Ensure the Ingress Controller is installed:

       ```bash
       kubectl get pods
       ```

       Information about the Ingress Controller will appear in the response. For example:

       ```bash
       NAME                       READY   STATUS    RESTARTS   AGE
       traefik-78d5c6f95b-2xk9p   1/1     Running   0          51s
       ```

       A new load balancer will be created. It will appear in the [control panel](https://my.selectel.ru/vpc/default/lbaas/load-balancers/): in the top menu, click **Products** and select **Cloud Servers** → **Load Balancers** section → **Load Balancers** tab.
  </TabItem>
</Tabs>

## Create an Ingress object \{#create-ingress}

1. [Connect to the cluster](/managed-kubernetes/clusters/connect-to-cluster.mdx).

2. Create a YAML file with a manifest for the Ingress object.

   Example manifest:

   ```yaml
   apiVersion: networking.k8s.io/v1
   kind: Ingress
   metadata:
     name: example-ingress
   spec:
     ingressClassName: traefik
     rules:
     - http:
         paths:
         - path: /
           pathType: Prefix
           backend:
             service:
               name: hello-nginx
               port:
                 number: 80 
   ```

3. Apply the manifest:

   ```bash
   kubectl apply -f <file_name>
   ```

   Specify `<file_name>` — the name of the YAML file with the manifest for creating the Ingress. For example, `ingress.yaml`.

<Formbricks />
