# service-ref

Reference to a Service that Kix does not render

This page is generated from [`kix/packages/experimental/service-ref`](https://github.com/kix-run/kix/tree/main/kix/packages/experimental/service-ref).

| | |
| --- | --- |
| Stability | Experimental |
| `package` value | `packages.experimental.service-ref` |

## Options

### `name`

Name of the Service, a DNS-1035 label. Null uses the instance name.

- **Type:** `null or string matching the pattern [a-z]([-a-z0-9]{0,61}[a-z0-9])?`
- **Default:** `null`

### `ports`

Ports of the Service. The first is `out.port`.

- **Type:** `non-empty (list of (submodule))`
- **Example:**

  ```nix
  [
    {
      port = 5433;
      targetPort = 5432;
    }
  ]
  ```

### `ports.*.port`

Port of the Service, which clients dial.

- **Type:** `16 bit unsigned integer; between 0 and 65535 (both inclusive)`

### `ports.*.protocol`

Protocol of the port.

- **Type:** `one of "TCP", "UDP", "SCTP"`
- **Default:** `"TCP"`

### `ports.*.targetPort`

Port the pods listen on, as a number. Null means the same as `port`.

- **Type:** `null or 16 bit unsigned integer; between 0 and 65535 (both inclusive)`
- **Default:** `null`

### `selector`

Labels of the pods behind the Service, which network policy selects. For a Service without a selector, such as one whose endpoints a controller writes, give the labels of the pods those endpoints name.

- **Type:** `attribute set of non-empty string`
- **Default:** `{ }`
- **Example:**

  ```nix
  {
    "app.example.com/cluster" = "old-db";
  }
  ```