[Yandex Cloud documentation](../../index.md) > [Yandex Managed Service for Kubernetes](../index.md) > [Application Load Balancer tools](index.md) > Ingress controller > Resource configuration > HttpBackendGroup

# HttpBackendGroup resource fields

`HttpBackendGroup` enables you to group backends, i.e., Kubernetes services processing traffic. The [Application Load Balancer Ingress controller](ingress-controller/index.md) uses these resources to create [backend groups](../../application-load-balancer/concepts/backend-group.md).

{% note tip %}

We recommend using the new [Yandex Cloud Gwin](gwin-index.md) controller instead of an ALB Ingress controller and Gateway API.

{% endnote %}

You need to add a reference to `HttpBackendGroup` to the [`Ingress` resource](ingress.md).

Using `HttpBackendGroup` enables extended Application Load Balancer functionality. A backend group can route traffic to either Kubernetes services or [Yandex Object Storage buckets](../../storage/concepts/bucket.md). `HttpBackendGroup` allows you to distribute traffic across backends proportionally using relative weights.

`HttpBackendGroup` is a [custom resource](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) from the `alb.yc.io` API group provided by an Ingress controller.

## HttpBackendGroup {#http-backend-group}

```yaml
apiVersion: alb.yc.io/v1alpha1
kind: HttpBackendGroup
metadata:
  name: <string>
spec:
  backends:
    - name: <string>
      weight: <int64>
      useHttp2: <bool>
      service:
         name: <int64>
         port:
           name: <string>
           number: <int32>
      storageBucket:
        name: <string>
      tls:
        sni: <string>
        trustedCa: <string>
      healthChecks:
        - http:
            path: <string>
          port: <int32>
          healthyThreshold: <int32>
          unhealthyThreshold: <int32>
          timeout: <string>
          interval: <string>
      loadBalancingConfig:
        balancerMode: <string>
        panicThreshold: <int64>
        localityAwareRouting: <int64>
    - ...
```

Where:

* `apiVersion`: `alb.yc.io/v1alpha1`
* `kind`: `HttpBackendGroup`
* `metadata` (`ObjectMeta`; this is a required field)
  
  Resource metadata.

  * `name` (`string`; this is a required field)

    Resource name. For more on the format, see [this Kubernetes guide](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names).
  
    This name should be specified in the `spec.rules.http.paths.backend.resource.name` field of the `Ingress` resource (see [this configuration](ingress.md)).

    Do not mistake this name for the Application Load Balancer backend group name.

* `spec` (`HttpBackendGroupSpec`)

  Resource specification.
  
  * `backends` (`[]HttpBackend`)
  
    List of backends in the group.
    
    * `name` (`string`; this is a required field)
    
      Backend name.
    
    * `weight` (`int64`)

      Backend weight. Backends in a group receive traffic in proportion to their weights.

      You should either specify weights for all backends in a group, or not specify them at all. If weights are not specified, traffic will be equally distributed across backends.

      A backend with zero or negative weight will not be receiving traffic.
    
    * `useHttp2` (`bool`)
    
      Enables HTTP/2 connections between load balancer nodes and backend endpoints.

      The default value is `false`, which means only HTTP/1.1 connections are allowed.

    * `service` (`ServiceBackend`)

      Reference to the [Kubernetes service](../concepts/index.md#service) to process requests as a backend.

      The referred `Service` resource must be described per the [standard configuration](service-for-ingress.md).

      You must specify a service or an Object Storage bucket, i.e.,`storageBucket`, for the backend. You cannot specify both at the same time.

      * `name` (`string`; this is a required field)
      
        Kubernetes service name.
      
      * `port` (`ServiceBackendPort`; this is a required field)
      
        Service port to which `Ingress` will direct traffic.
      
        The field is designed for ingress controller operation and has no equivalents in Application Load Balancer.
      
        * `name` (`string`)
      
          Service port name.
      
          This name must match one of the `Service` resource `spec.ports.name` values. For more information, see the [resource specification](service-for-ingress.md).
      
          You must specify either the service port name or its `number`, but not both.
      
        * `number` (`int32`)
      
          Service port number.
      
          This number must match one of the port numbers specified in the `spec.ports.port` fields of the `Service` resource. For more information, see the [resource specification](service-for-ingress.md).
      
          You must specify either the service port `name` or its number, but not both.
        
    * `storageBucket` (`StorageBucketBackend`)

      [Yandex Object Storage bucket](../../storage/concepts/bucket.md) for processing requests as a backend. To learn more about using a bucket as a backend, see [Backend types](../../application-load-balancer/concepts/backend-group.md#types).

      {% note warning %}
      
      To use a bucket as a backend, [grant public access](../../storage/operations/buckets/bucket-availability.md) for reading its objects.
      
      {% endnote %}

      You must specify a bucket or Kubernetes `service` for the backend. You cannot specify both at the same time.
      
      * `name` (`string`; this is a required field)
      
        Bucket name.
        
    * `tls` (`BackendTLS`)
    
      TLS connection settings for the load balancer nodes and backend endpoints.
    
      If this field is specified, the load balancer will establish TLS connections to the backend, comparing received certificates with the one specified in the `trustedCa` field. Otherwise, the load balancer will use unencrypted connections to the backend.
        
      * `sni` (`string`)
      
        SNI domain name for TLS connections.
      
      * `trustedCa` (`string`)
      
        Contents of the X.509 certificate issued by a certificate authority in PEM format.

    * `healthChecks` (`[]HealthChecks`)

      Custom [health checks](../../application-load-balancer/concepts/backend-group.md#health-checks) settings for Managed Service for Kubernetes cluster applications.

      By default, the Application Load Balancer Ingress controller receives L7 load balancer health check requests on TCP port `10501`. Then it checks [kube-proxy](https://kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/) pods on each cluster node. Given that kube-proxy is healthy, the process is as follows: if an application does not respond in a particular pod, Kubernetes redirects traffic to a different pod or node.
      
      You can use `healthChecks` settings to [customize application health checks](../tutorials/custom-health-checks.md).

      * `http` (`HttpBackend`)

        Specifies HTTP as the health check protocol.

        * `path` (`string`)

          Application endpoint URI path for health check requests, e.g., `/health`.

      * `port` (`int32`)

        Cluster node port for checking application availability. This port should match the `spec.ports.nodePort` value of the `NodePort` [Service](service-for-ingress.md) resource.

        The application will be available for health checks at `http://<node_IP_address>:<port>/<path>`.

      * `healthyThreshold` (`int32`)

        Number of consecutive successful checks required to consider the application endpoint healthy.

      * `unhealthyThreshold` (`int32`)

        Number of consecutive failed checks required to consider the application endpoint unhealthy.

      * `timeout` (`string`)

        Response timeout in seconds. You can specify values between `1s` and `60s`.

      * `interval` (`string`)

        Health check request interval in seconds.

        You can specify values between `1s` and `60s`. `interval` must exceed `timeout` by at least one second.

      {% note info %}
      
      You can also configure application health checks using the [ingress.alb.yc.io/health-checks](service-for-ingress.md#annot-health-checks) annotation of the [Service](service-for-ingress.md) resource.
      
      {% endnote %}

    * `loadBalancingConfig` (`LoadBalancingConfig`)

      Load balancing settings.

      * `balancerMode` (`string`)

        Mode of traffic distribution across backend endpoints. The possible values are `ROUND_ROBIN`, `RANDOM`, `LEAST_REQUEST`, and `MAGLEV_HASH`. Learn more about each mode [here](../../application-load-balancer/concepts/backend-group.md#balancing-mode).

      * `panicThreshold` (`int64`)

        Percentage of healthy endpoints. Values below this threshold will trigger the [panic mode](../../application-load-balancer/concepts/backend-group.md#panic-mode).

        The default value is `0`, which means the panic mode will never be activated.

      * `localityAwareRouting` (`int64`)

        Percentage of incoming traffic the load balancer forwards to its availability zone backends. The remaining traffic is evenly distributed across other availability zones. [More on locality-aware routing](../../application-load-balancer/concepts/backend-group.md#locality).

        The default value is `0`.