Skip to content

Traffic splitting across revisions in ElpioService#35

Merged
joy-software merged 1 commit into
mainfrom
feat/41-traffic-splitting
Jun 7, 2026
Merged

Traffic splitting across revisions in ElpioService#35
joy-software merged 1 commit into
mainfrom
feat/41-traffic-splitting

Conversation

@joy-software

Copy link
Copy Markdown
Contributor

Closes #41.

Exposes Knative's multi-revision traffic split through ElpioService.

What changed

  • models/service.py: new optional traffic list of TrafficTarget (revisionName? / latestRevision? / percent / tag?). Validators enforce that percents sum to 100 when the list is non-empty and that each entry sets exactly one of revisionName or latestRevision.
  • engines/knative.py: render() emits spec.traffic when set, via a pure _traffic_target helper. Unset traffic keeps today's implicit 100%-to-latest behavior. KEDA ignores traffic (no revision model), noted in a comment.
  • CRDs: traffic array schema added to deploy/crds/elpioservice.yaml and the Helm copy deploy/helm/elpio/crds/elpioservice.yaml.
  • Tests: 80/20 split renders matching spec.traffic, latest-revision target, percents-not-100 raises, exactly-one-target validation, and no-traffic renders no traffic block.

Checks

ruff check src tests clean. pytest -m "not e2e and not integration": 159 passed.

Expose Knative's per-revision traffic split through the ElpioService spec.
An optional traffic list routes a percent of requests to a named revision
or the latest ready one, optionally under a tag. The model validates that
percents sum to 100 and that each entry pins exactly one of revisionName
or latestRevision.

The Knative engine emits these as spec.traffic; with no traffic set it
keeps the implicit 100%-to-latest behavior. KEDA ignores traffic since it
has no revision model. CRD schema updated in both the base and Helm copies.
@joy-software joy-software merged commit 71591ec into main Jun 7, 2026
7 of 8 checks passed
@joy-software joy-software deleted the feat/41-traffic-splitting branch June 7, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant