Skip to main content

Ingress and Ingress Controller

Ingress is a Kubernetes object that defines rules for external traffic routing, load balancing, and SSL termination. An Ingress Controller 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 guide in the Kubernetes documentation. For example, you can install the Traefik Ingress Controller.

After installing the Ingress Controller, create an Ingress.

Install Traefik Ingress Controller

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

  • IP address — public;
  • type — 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 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.

  1. Make sure that the pool has an allocated quota for at least one public floating IP address.

  2. Connect to the cluster.

  3. Install the Helm package manager.

  4. Add the traefik repository to Helm:

    helm repo add traefik https://traefik.github.io/charts
  5. Update the repository list:

    helm repo update
  6. Install the Ingress Controller:

    helm install traefik traefik/traefik
  7. Ensure the Ingress Controller is installed:

    kubectl get pods

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

    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: in the top menu, click Products and select Cloud Servers → Load Balancers section → Load Balancers tab.

Create an Ingress object

  1. Connect to the cluster.

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

    Example manifest:

    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:

    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.