Traffic splitting across revisions in ElpioService#35
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #41.
Exposes Knative's multi-revision traffic split through
ElpioService.What changed
models/service.py: new optionaltrafficlist ofTrafficTarget(revisionName?/latestRevision?/percent/tag?). Validators enforce that percents sum to 100 when the list is non-empty and that each entry sets exactly one ofrevisionNameorlatestRevision.engines/knative.py:render()emitsspec.trafficwhen set, via a pure_traffic_targethelper. Unset traffic keeps today's implicit 100%-to-latest behavior. KEDA ignores traffic (no revision model), noted in a comment.trafficarray schema added todeploy/crds/elpioservice.yamland the Helm copydeploy/helm/elpio/crds/elpioservice.yaml.spec.traffic, latest-revision target, percents-not-100 raises, exactly-one-target validation, and no-traffic renders no traffic block.Checks
ruff check src testsclean.pytest -m "not e2e and not integration": 159 passed.