# edge

Generated from the code · as of CLI 0.6.0

Which service answers HTTP for the arc, or none if nothing should.

- **Type:** `none` or map
- **Required:** yes
- **Errors:** [`edge-undeclared`](https://docs.omniarc.eu/errors/edge-undeclared.md), [`edge-service-unknown`](https://docs.omniarc.eu/errors/edge-service-unknown.md), [`edge-service-not-deployed`](https://docs.omniarc.eu/errors/edge-service-not-deployed.md), [`edge-port-zero`](https://docs.omniarc.eu/errors/edge-port-zero.md), [`edge-port-unpublished`](https://docs.omniarc.eu/errors/edge-port-unpublished.md), [`edge-port-host-bound`](https://docs.omniarc.eu/errors/edge-port-host-bound.md), [`edge-port-not-fixed`](https://docs.omniarc.eu/errors/edge-port-not-fixed.md), [`overlay-parse`](https://docs.omniarc.eu/errors/overlay-parse.md)

The edge is the one public HTTP route of an arc. Point it at a service and the container port that service listens on, or write `edge: none` for an arc with no web address.

The key is required so that having no route is something you chose rather than something you find out later. Leaving it out is an error.

`omniarc sync` guesses it, in order: the one published HTTP-looking port (80, 443, 3000, 5000, 8000, 8080); else the one service publishing such a port through a variable host port (`${LISTEN_HTTP_PORT}:80`), whose variable the arc's `.env` must set unless compose gives it a default (`${LISTEN_HTTP_PORT:-80}`); else the one fixed published port on a service that is not a database or cache. Where a step finds several candidates, the guess stops there with `edge: none` and lists them for you to choose one; a later step is tried only when every earlier one found none.

The port must also be published in compose at one fixed host port. Add a line like this to the service:

```yaml
ports: ["80:80"]
```

These do not work, and each has its own error: no `ports` entry for that container port, a port bound to one address such as `127.0.0.1:80:80`, a port with no host side such as `"80"`, and a range such as `"8000-8010:80"`.

The service must be deployed. An edge that points at a service with `deploy: false` is refused.

```yaml
edge: { service: web, port: 80 }
```

## `edge.service`

The compose service that answers HTTP.

- **Type:** string
- **Required:** yes
- **Errors:** [`edge-service-unknown`](https://docs.omniarc.eu/errors/edge-service-unknown.md), [`edge-service-not-deployed`](https://docs.omniarc.eu/errors/edge-service-not-deployed.md)

It must be a service compose defines in the profiles you turned on, and it must be deployed.

## `edge.port`

The container port the service listens on.

- **Type:** integer, 1 to 65535
- **Required:** yes
- **Errors:** [`edge-port-zero`](https://docs.omniarc.eu/errors/edge-port-zero.md), [`edge-port-unpublished`](https://docs.omniarc.eu/errors/edge-port-unpublished.md), [`edge-port-host-bound`](https://docs.omniarc.eu/errors/edge-port-host-bound.md), [`edge-port-not-fixed`](https://docs.omniarc.eu/errors/edge-port-not-fixed.md), [`overlay-parse`](https://docs.omniarc.eu/errors/overlay-parse.md)

This is the port inside the container, not the host port. The matching host port comes from the `ports` entry in compose.

**Example: shop/arc.yaml**

```yaml
arc: shop
edge: { service: web, port: 3000 }
resources: { cpu: "1", memory: 1Gi, disk: 5Gi }
services:
  web:
    kind: web-service
    contains_pii: false
  db:
    kind: database
    contains_pii: true
    anonymize:
      engine: postgres
      database: shop
      user: shop
      rules:
        - { table: customers, column: email, transform: fake-email }
```
