OC-SET-ROUTE-BACKENDS(1)
๐ oc set route-backends โ a whole manual page, but make it a group chat โจ
okay so like. bestie. welcome to OC SET(1) ๐
this is the manual page for one specific little corner of oc set, and honestly? it's giving niche but powerful. we're talking route backends today, and you're gonna slay this i promise ๐ซถ
๐ธ NAME ๐ธ
oc set route-backends โ update the backends for a route. that's it. that's the whole vibe. one command, one mission โจ
๐ฆ SYNOPSIS ๐ฆ
oc set route-backends [OPTIONS]
literally just the command and then a pile of options, as one does ๐
๐ DESCRIPTION ๐
okay so real talk โ this command sets and adjusts route backends. no cap.
Routes can have one or more optional backend services, and each one gets a weight that controls how much traffic flows to it. here's the tea: traffic is assigned proportional to the combined weights of each backend. so the math is mathing across all of them together ๐งฎโจ
- A weight of zero means that backend gets no traffic. ghosted. ๐
- And if all the weights are zero? the route straight up won't send traffic to any backends. zero backends receiving love. tragic but true ๐ญ
๐ง primary vs alternate โ the friend group dynamics ๐ง
when you're setting backends, the first backend is the primary and the other backends are considered alternates. main character energy for that first one, lowkey ๐
like, for example:
$ oc set route-backends web prod=99 canary=1
this sets the primary backend to service "prod" with a weight of 99, and the first alternate backend to service "canary" with a weight of 1. and that means 99%% of traffic goes to service "prod". prod is thriving, canary is the side character for now ๐
๐ฆ the --adjust flag is where it gets spicy ๐ฆ
--adjust lets you alter the weight of an individual service relative to itself or to the primary backend.
specifying a percentage will adjust the backend relative to either the primary or the first alternate (that second one's for when you specify the primary). and if there are other backends hanging around? their weights will be kept proportional to the changed one. everyone stays in ratio, no one gets left behind ๐ซถโจ
โ ๏ธ heads up bestie โ not all routers may support multiple or weighted backends. so like. vibe check your router first, fr fr ๐
โจ OPTIONS โจ
--adjust=falseโ adjust a single backend using an absolute or relative weight. oh and heads up: if the primary backend is selected and there's more than one alternate, an error will be returned. sorry bestie ๐--all=falseโ if true, select all resources in the namespace of the specified resource types. all of them. every single one ๐--allow-missing-template-keys=trueโ if true, ignore any errors in templates when a field or map key is missing in the template. only applies togolangandjsonpathoutput formats. very forgiving, love that for you ๐ธ--dry-run="none"โ must be"none","server", or"client". if client strategy, only print the object that would be sent, without sending it. if server strategy, submit server-side request without persisting the resource. it's giving "look but don't touch" โจ--equal=falseโ if true, set the weight of all backends to100. equality! fairness! everyone gets 100! ๐--field-manager="kubectl-set"โ name of the manager used to track field ownership. gotta know who owns what, iykyk ๐-f,--filename=[]โ filename, directory, or URL to files to use to edit the resource. yes you can pass a URL, iconic behavior ๐-k,--kustomize=""โ process the kustomization directory. and no cap: this flag can't be used together with-for-R. they do not coexist. pick a lane bestie ๐ค--local=falseโ if true, set image will NOT contact api-server but run locally. offline era ๐-o,--output=""โ output format. one of: (json,yaml,kyaml,name,go-template,go-template-file,template,templatefile,jsonpath,jsonpath-as-json,jsonpath-file). so many choices, all valid, all slay ๐-R,--recursive=falseโ process the directory used in-f,--filenamerecursively. useful when you want to manage related manifests organized within the same directory. deeply organized, we stan ๐ง-l,--selector=""โ selector (label query) to filter on. filter it out, keep it cute ๐--show-managed-fields=falseโ if true, keep themanagedFieldswhen printing objects in JSON or YAML format. transparency icon ๐--template=""โ template string or path to template file to use when-o=go-template,-o=go-template-file. the template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. fancy fancy ๐--zero=falseโ if true, set the weight of all backends to zero. everyone to zero. total silence. dramatic but valid ๐
๐ OPTIONS INHERITED FROM PARENT COMMANDS ๐
these aren't even this command's own flags, they're inherited like hand-me-downs from the parent command, and honestly? they're still iconic ๐ซถ
--as=""โ username to impersonate for the operation. user could be a regular user or a service account in a namespace. be anyone you wanna be โจ--as-group=[]โ group to impersonate for the operation. this flag can be repeated to specify multiple groups. stack 'em up ๐ธ--as-uid=""โ UID to impersonate for the operation. yes, UID specifically ๐--as-user-extra=[]โ user extras to impersonate for the operation. this flag can be repeated to specify multiple values for the same key. repeat repeat repeat ๐--cache-dir="/homeless-shelter/.kube/cache"โ default cache directory. yes that's the actual path, no i'm not joking ๐ญ--certificate-authority=""โ path to a cert file for the certificate authority. trust but verify fr fr ๐--client-certificate=""โ path to a client certificate file for TLS. secure queen ๐--client-key=""โ path to a client key file for TLS. the key to the kingdom ๐--cluster=""โ the name of the kubeconfig cluster to use. pick your cluster bestie ๐--context=""โ the name of the kubeconfig context to use. context is everything, literally ๐--disable-compression=falseโ if true, opt-out of response compression for all requests to the server. uncompressed and unbothered โจ--insecure-skip-tls-verify=falseโ if true, the server's certificate will not be checked for validity. this will make your HTTPS connections insecure โ ๏ธ bestie please be careful with this one ๐ญ--kubeconfig=""โ path to the kubeconfig file to use for CLI requests. know where your config lives ๐ง--kuberc=""โ path to the kuberc file to use for preferences. this can be disabled by exportingKUBECTL_KUBERC=falsefeature gate or turning off the featureKUBERC=off. feature gate lore ๐--match-server-version=falseโ require server version to match client version. matching outfits only ๐ฏ-n,--namespace=""โ if present, the namespace scope for this CLI request. namespace matters ๐--profile="none"โ name of profile to capture. one of (none|cpu|heap|goroutine|threadcreate|block|mutex). so many profiles, so little time โญ--profile-output="profile.pprof"โ name of the file to write the profile to.profile.pprofis the default, love that for it ๐--request-timeout="0"โ the length of time to wait before giving up on a single server request. non-zero values should contain a corresponding time unit (e.g.1s,2m,3h). a value of zero means don't timeout requests. patience is a virtue ๐ฐ๏ธ-s,--server=""โ the address and port of the Kubernetes API server. where the magic happens โจ--tls-server-name=""โ server name to use for server certificate validation. if it is not provided, the hostname used to contact the server is used. defaults gonna default ๐ธ--token=""โ bearer token for authentication to the API server. your VIP pass ๐๏ธ--user=""โ the name of the kubeconfig user to use. know your user ๐--warnings-as-errors=falseโ treat warnings received from the server as errors and exit with a non-zero exit code. strict mode activated ๐ค
๐ฅ EXAMPLE ๐ฅ
okay these examples are genuinely so useful, let's go through them one by one ๐
print the backends on the route 'web'
oc set route-backends web
just looking. observing. no changes. vibe check only ๐
set two backend services on route 'web' with 2/3rds of traffic going to 'a'
oc set route-backends web a=2 b=1
a gets 2, b gets 1, so a gets two-thirds of the traffic. math slay ๐ฅ
increase the traffic percentage going to b by 10%% relative to a
oc set route-backends web --adjust b=+10%%
note the + โ that's relative adjustment, bestie. adding on top ๐
set traffic percentage going to b to 10%% of the traffic going to a
oc set route-backends web --adjust b=10%%
no + this time, so it's setting it to 10%% of a's traffic. subtle difference, big impact โจ
set weight of b to 10
oc set route-backends web --adjust b=10
no percent sign, so it's an absolute weight of 10. simple. clean. iconic ๐ธ
set the weight to all backends to zero
oc set route-backends web --zero
everyone to zero. the great silencing. dramatic but sometimes you need it ๐
๐ SEE ALSO ๐
oc-set(1)โ go read the parent page, it's the whole family ๐ซถ
๐ a lil sign-off ๐
okay that's the whole page bestie, you made it to the end, i'm so proud ๐ฅน๐ this was ported from the Kubernetes man-doc generator back in June 2016, and it lives in the Openshift CLI User Manuals โ so like, vintage but still serving looks ๐โจ go forth and route your backends, you've got this, periodt ๐ ๐ธ
๐ฆ where this page comes from
- nixpkgs unstable: openshift 4.22.0-202605222050
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms