[Yandex Cloud documentation](../../index.md) > [Yandex Application Load Balancer](../index.md) > Tools for Managed Service for Kubernetes > Gateway API > Resource configuration > Gateway API service

# Fields and annotations of the Service resource for the Gateway API

The `Service` resource represents a [Kubernetes service](../../managed-kubernetes/concepts/index.md#service). For the [Gateway API](../tools/k8s-gateway-api/index.md), services are backends across which incoming traffic is distributed within a Managed Service for Kubernetes cluster. Services operating as Application Load Balancer backends are specified in the [HTTPRoute](http-route.md) resource.

{% note tip %}

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

{% endnote %}

`Service` is a standard Kubernetes resource. Below, we describe its fields and annotations used by the Application Load Balancer tools for Managed Service for Kubernetes. For resource configuration details, see [this Kubernetes guide](https://kubernetes.io/docs/reference/kubernetes-api/service-resources/service-v1/).

## Service {#service}

# Service

```yaml
apiVersion: v1
kind: Service
metadata:
  name: <string>
spec: <ServiceSpec>
```

#|
|| **Field**        | **Value / Type**   | **Description**          ||
|| `apiVersion`    | `v1`                   | **This is a required field**.

Kubernetes API version. ||
|| `kind`          | `Service`              | Resource type.          ||
|| `metadata`      | `ObjectMeta`           | **This is a required field**.

Resource metadata. ||
|| `metadata.name` | `string`               | **This is a required field**.

[Resource name](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names).

Do not mistake this name for the Application Load Balancer load balancer name. ||
|| `spec`          | `ServiceSpec`          | **This is a required field**.

Resource specification. ||
|#

{% cut "Example" %}

```yaml
apiVersion: v1
kind: Service
metadata:
  name: alb-demo-1
spec:
  selector:
    app: alb-demo-1
  type: NodePort
  ports:
    - name: http
      port: 80
      protocol: TCP
      nodePort: 30081
```

{% endcut %}

## ServiceSpec {#servicespec}

# ServiceSpec

```yaml
type: NodePort
ports:
  - <ServicePort>
  -
```

#|
|| **Field** | **Value / Type** | **Description** ||
|| `type`    | `NodePort`        | **This is a required field**.

Service type.

{% note warning %}

Kubernetes backend services referenced in `Ingress` rules (directly or via `HttpBackendGroup`/`GrpcBackendGroup`), must be of type `NodePort`. For more information about this type, see the relevant [Kubernetes article](https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport).

{% endnote %} ||
|| `ports`   | `[]ServicePort`   | **This is a required field**.

List of ports the service is available on. ||
|#

## ServicePort {#ports}

# ServicePort

```yaml
port: <int32>
name: <string>
protocol: <protocol>
nodePort: <int32>
```

#|
|| **Field** | **Value / Type** | **Description** ||
|| `port`    | `int32`      | **This is a required field**.
Number of the port the service is available on.

You can use this number if you designate a service as a backend:

* In `Ingress`, in the `spec.rules.http.paths.backend.service.port.number` field (see the [configuration](ingress.md#backend)).
* In `HttpBackendGroup`, in the `spec.backends.service.port.number` field (see the [configuration](http-backend-group.md)).
||
|| `name` | `string` | Service port name.

You can use this name if you designate a service as a backend:

* In `Ingress`, in the `spec.rules.http.paths.backend.service.port.name` field (see the [configuration](ingress.md#backend)).
* In `HttpBackendGroup`, in the `spec.backends.service.port.name` field (see the [configuration](http-backend-group.md)).
||
|| `protocol` | `TCP` | Port network protocol; `TCP` only. ||
|| `nodePort` | `int32` | Number of the port opened on the cluster nodes where the service is deployed. The load balancer routes traffic to this port, and Kubernetes forwards the traffic to the service on its port in the `port` parameter.

The value matches the backend port in the Application Load Balancer [backend group](../concepts/backend-group.md).
||
|#