mirror of https://github.com/knative/client.git
2.0 KiB
2.0 KiB
Traffic Splitting Examples
- Tag revisions
echo-v1
andecho-v2
asstable
andstaging
respectively:
kn service update svc --tag echo-v1=stable --tag echo-v2=staging
- Ramp up/down revision
echo-v3
to20%
, adjusting other traffic to accommodate:
kn service update svc --traffic echo-v3=20 --traffic echo-v2=80
- Give revision
echo-v3
tagcandidate
, without otherwise changing any traffic split:
kn service update svc --tag echo-v3=candidate
- Give
echo-v3
tagcandidate
, and2%
of traffic adjusting other traffic to go to revisionecho-v2
:
kn service update svc --tag echo-v3=candidate --traffic candidate=2 --traffic echo-v2=98
- Update tag for
echo-v3
fromcandidate
tocurrent
:
kn service update svc --untag candidate --tag echo-v3=current
- Remove tag
current
fromecho-v3
:
kn service update svc --untag current
- Remove
echo-v3
having no tag(s) entirely, adjustingecho-v2
to fill up:
kn service update svc --traffic echo-v2=100 # a target having no-tags or no-traffic gets removed
- Remove
echo-v1
and its tagold
from the traffic assignments entirely:
kn service update svc --untag old --traffic echo-v1=0
- Tag revision
echo-v1
withstable
as well ascurrent
, and50-50%
traffic split to each:
kn service update svc --tag echo-v1=stable,echo-v2=current --traffic stable=50,current=50
- Revert all the traffic to the latest ready revision of service:
kn service update svc --traffic @latest=100
- Tag latest ready revision of service as
current
:
kn service update svc --tag @latest=current
- Update tag for
echo-v4
totesting
and assign all traffic to it:
kn service update svc --untag oldv4 --tag echo-v4=testing --traffic testing=100
- Update
latest
tag ofecho-v1
withold
tag, givelatest
toecho-v2
:
kn service update svc --untag latest --tag echo-v1=old --tag echo-v2=latest