Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/fast-path.yml
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,7 @@ jobs:
python3 -m pip install -r ci/agent-relay/kind/requirements.txt
make local-acceptance-test PYTHON=python3
python3 ci/agent-relay/test_control_webapp_names.py -v
python3 ci/agent-relay/test_eks_alb_ingress.py -v
python3 ci/agent-relay/test_release_candidate.py -v
python3 ci/agent-relay/test_release_candidate_gate.py -v
python3 ci/agent-relay/test_install_pack.py -v
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ jobs:
python3 -m pip install -r ci/agent-relay/kind/requirements.txt
make local-acceptance-test PYTHON=python3
python3 ci/agent-relay/test_control_webapp_names.py -v
python3 ci/agent-relay/test_eks_alb_ingress.py -v
python3 ci/agent-relay/test_release_candidate.py -v
python3 ci/agent-relay/test_release_candidate_gate.py -v
python3 ci/agent-relay/test_install_pack.py -v
Expand Down
2 changes: 1 addition & 1 deletion charts/agent-relay/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: agent-relay
description: Self-hosted Agent Relay messaging and sessions suite
type: application
version: 0.7.63
version: 0.7.66
appVersion: "0.1.0"
kubeVersion: ">=1.28.0-0"
annotations:
Expand Down
82 changes: 82 additions & 0 deletions charts/agent-relay/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,88 @@ read paths to `agent-relay-read-api`, and refuses all other History-host paths
at the ALB. Set the script's Service overrides only when the private overlay
renames those Services.

### EKS ALB Ingress

The script stays the documented way to publish the EKS edge. The alternative is
to render the same Ingress from this release, so an install's edge is applied
and versioned with it: set `eksIngress.enabled=true` (default false). For the
same options the chart's Ingress equals the script's output (annotations and
spec, rule order and `pathType` included; the chart only adds
`app.kubernetes.io/name` and `app.kubernetes.io/instance` labels), which
`ci/agent-relay/test_eks_alb_ingress.py` proves by running both. The Ingress
goes into the release namespace. `eksIngress` and `gkeIngress` are exclusive.

```yaml
eksIngress:
enabled: true
domain: relay.example.com
certificateArn: arn:aws:acm:us-east-1:111111111111:certificate/00000000-0000-0000-0000-000000000000
```

| Option | Script variable | Default |
| --- | --- | --- |
| `eksIngress.name` | `EKS_ALB_INGRESS_NAME` | `agent-relay` |
| `eksIngress.className` | `EKS_INGRESS_CLASS` | `alb` |
| `eksIngress.domain` | `EKS_ALB_DOMAIN` | required |
| `eksIngress.certificateArn` | `EKS_ALB_CERT_ARN` | required |
| `eksIngress.history.enabled` | `EKS_ALB_HISTORY` | `true` |
| `eksIngress.history.readOnly` | `EKS_ALB_HISTORY_READ_ONLY` | `false` |
| `eksIngress.ingest.enabled` | `EKS_ALB_INGEST` | `null`: on when the history host is on and not read-only |
| `eksIngress.ingest.serviceName`, `servicePort` | `EKS_ALB_INGEST_SERVICE`, `_PORT` | `agent-relay-ingest-edge`, `80` |
| `eksIngress.readApi.serviceName`, `servicePort` | `EKS_ALB_READ_API_SERVICE`, `_PORT` | `agent-relay-read-api`, `80` |
| `eksIngress.flows.enabled`, `serviceName`, `servicePort` | `EKS_ALB_RELAYFILE_CONTROL`, `_SERVICE`, `_PORT` | `false`, `relayfile-control`, `3100` |
| `eksIngress.chief.serviceName`, `servicePort` | `EKS_ALB_CHIEF_SERVICE`, `_PORT` | empty (off), `3200` |
| `eksIngress.control.serviceName` | `EKS_ALB_CONTROL_SERVICE` | `relay-control` |
| `eksIngress.webapp.serviceName` | `EKS_ALB_WEBAPP_SERVICE` | `relay-webapp` |
| `eksIngress.controlPaths` | none | `[/cloud/api, /login, /relay-node]` |

The render refuses what the script refuses: no domain or certificate; read-only
without the history host or with ingest on; ingest off on a history host that is
not read-only; ingest on without the history host; Service names that are not
DNS labels and ports outside 1-65535 (each checked only when its route is
rendered). It also refuses non-boolean switches, a domain that is not a DNS
name, a certificate that is not an ARN, and malformed `controlPaths`.

`controlPaths` is the list of dashboard-host (`<domain>`) paths sent to the
control API ahead of the dashboard catch-all, in order (Prefix paths; with Chief
on, each becomes Exact plus `<path>/*` after the Chief wildcards). The script has
no such option; the default is the list it emits. Pin the list your live ALB has
so that a chart upgrade which changes the default does not change your
listener rules unannounced.

Backends are named, never looked up and never required to be part of this
release: Flows (relayfile-control) and Chief are separate releases, and a
read-only history host may name a read API Service this release does not
install. A wrong name renders and the ALB answers 503 for that route.

#### Adopting an Ingress that was applied with the script

Helm will not take over an existing object that lacks its ownership metadata;
the upgrade fails with `invalid ownership metadata`. To move an install from the
script to `eksIngress` without a new load balancer:

1. Set the `eksIngress` options to the values the script ran with (same
`name`, class, domain, certificate, Service overrides; pin `controlPaths` to
the live list).
2. Render and diff against the live object:
`helm template <release> charts/agent-relay -n <namespace> -f <values> --show-only templates/eks-alb-ingress.yaml > eks-ingress.yaml`,
then `kubectl diff -f eks-ingress.yaml`. Only the two chart labels may
differ.
3. Add the three ownership fields to the live Ingress:

```sh
kubectl -n <namespace> annotate ingress <name> \
meta.helm.sh/release-name=<release> meta.helm.sh/release-namespace=<namespace>
kubectl -n <namespace> label ingress <name> app.kubernetes.io/managed-by=Helm
```

4. `helm upgrade` with `eksIngress.enabled=true`.

The same Ingress name and no `alb.ingress.kubernetes.io/group.name` mean the
controller reconciles the same object onto the same load balancer, so its DNS
name and the records pointing at it stay. Stop running the script for that
install afterwards: a later `kubectl apply` of its output would fight Helm.

Install into `agent-relay-<environment>` (or another namespace explicitly
bound in Terraform). EKS Pod Identity associations must name that namespace
and these exact Service Accounts:
Expand Down
23 changes: 23 additions & 0 deletions charts/agent-relay/ci/eks-ingress-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# The EKS ALB edge rendered from the release (eksIngress) on the proof shape,
# with every route family on: history (ingest), Flows and Chief. Layered on
# values-gcp-proof.yaml by scripts/ci/charts.sh (lint --strict, kubeconform);
# ci/agent-relay/test_eks_alb_ingress.py proves equality with the script.
gkeIngress:
enabled: false
eksIngress:
enabled: true
domain: relay.example.com
certificateArn: arn:aws:acm:us-east-1:111111111111:certificate/00000000-0000-0000-0000-000000000000
flows:
enabled: true
chief:
serviceName: relaychief-control
# Render-only identities as in gcp-proof-values.yaml.
relay-control:
image:
digest: sha256:2222222222222222222222222222222222222222222222222222222222222222
encryption:
keyId: proof-1
relay-webapp:
image:
digest: sha256:9bfc0c6b873411c7a0da60d746883bdef6aafd86a9b733c719500a603890b6fe
13 changes: 13 additions & 0 deletions charts/agent-relay/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
{{- if and (kindIs "map" $brand) (or $brand.svg $brand.existingConfigMap) (dig "control" true (.Values.components | default dict)) (not (dig "webapp" true (.Values.components | default dict))) (not (dig "login" "logoUrl" "" (index .Values "relay-control" | default dict))) }}
{{- fail "global.branding.logo is hosted by relay-webapp, but components.webapp=false: the sign-in page would link a logo nothing serves. Enable components.webapp, or host the logo yourself and set relay-control.login.logoUrl" }}
{{- end }}
{{- if and (eq (dig "enabled" false (.Values.eksIngress | default dict) | toString) "true") (dig "enabled" false (.Values.gkeIngress | default dict)) }}{{ fail "eksIngress.enabled and gkeIngress.enabled are exclusive: an install has one edge" }}{{ end }}
{{- include "agent-relay.validateRemovedHistory" . }}
{{- include "agent-relay.validateDurableActors" . }}
{{- include "agent-relay.validateSingleHost" . }}
Expand Down Expand Up @@ -274,3 +275,15 @@ can't derive for its children: the Control Service relaygate pulls from. */ -}}
{{- if ne (int (dig "controlServicePort" 80 $cp)) (int (dig "service" "port" 80 $control)) }}{{ fail (printf "global.relaygate.controlPolicy.controlServicePort must equal relay-control.service.port (%v)" (dig "service" "port" 80 $control)) }}{{ end -}}
{{- end -}}
{{- end }}

{{- /* "true" when .name is a lowercase DNS name (RFC 1123 subdomain): at most
.max characters, each dot-separated label 1-63 letters, digits and inner
hyphens, so no empty label ("a..b") and no label starting or ending with "-". */ -}}
{{- define "agent-relay.isDnsName" -}}
{{- $name := toString .name -}}
{{- $ok := and $name (le (len $name) (int .max)) -}}
{{- range $l := splitList "." $name }}
{{- if not (and (le (len $l) 63) (regexMatch "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" $l)) }}{{ $ok = false }}{{ end -}}
{{- end -}}
{{- if $ok }}true{{ end -}}
{{- end }}
Loading
Loading