OC-SET-ROUTE-BACKENDS(1)

๐Ÿ“ฆ
version 4.22.0 ยท 2 versions
, in nixpkgs unstable

๐Ÿ‘‘ 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 to golang and jsonpath output 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 to 100. 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 -f or -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, --filename recursively. 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 the managedFields when 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 exporting KUBECTL_KUBERC=false feature gate or turning off the feature KUBERC=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.pprof is 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 ๐Ÿ’…

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