OC-ADM-TAINT(1)
π OC ADM TAINT π
okay bestie, welcome to oc adm taint β part of the OC ADM(1) manual fam, dated June 2016, and no cap this page is gonna make you a taint expert in like five minutes. grab a strawberry π and let's go.
β¨ NAME β¨
oc adm taint β update the taints on one or more nodes π
π¦ SYNOPSIS π¦
oc adm taint [OPTIONS]
that's it. that's the whole vibe. options are where the drama lives tho π
πΈ DESCRIPTION πΈ
Update the taints on one or more nodes. that's the whole mission, literally.
the way this works is a whole lil art form, so here's the tea β:
- a taint is made of three things: a key, a value, and an effect. when you pass it as an argument, you write it like
key=value:effect. - the key has to start with a letter or a number, and after that it can have letters, numbers, hyphens, dots, and underscores, up to 253 characters. so many characters. iconic.
- bonus round: the key can optionally start with a DNS subdomain prefix and a single
/, likeexample.com/my-app. fancy β¨ - the value is optional. if you do give one, it must start with a letter or number, and it can contain letters, numbers, hyphens, dots, and underscores, up to 63 characters. shorter than the key, we respect the hierarchy π
- the effect has to be one of
NoSchedule,PreferNoSchedule, orNoExecute. those three. no fourth option, don't try it π - and rn? currently taint can only apply to node. that's the limit, that's the boundary, we stay in our lane π«Ά
π OPTIONS π
--all=falseβ select all nodes in the cluster. the whole group chat, not just one person π£--allow-missing-template-keys=trueβ if true, just ignore any errors in templates when a field or map key is missing from the template. lowkey forgiving. only applies togolangandjsonpathoutput formats tho.--dry-run="none"β must be"none","server", or"client". if it's the client strategy, it only prints the object that would be sent, without actually sending it (window shopping ποΈ). if it's the server strategy, it submits a server-side request without persisting the resource. nothing gets saved, it's giving dress rehearsal.--field-manager="kubectl-taint"β name of the manager used to track field ownership. this is the lil name tag on your changes π·οΈ-o,--output=""β output format. one of:json,yaml,kyaml,name,go-template,go-template-file,template,templatefile,jsonpath,jsonpath-as-json,jsonpath-file. pick your aesthetic.--overwrite=falseβ if true, allow taints to be overwritten. otherwise it rejects taint updates that would overwrite existing taints. default is no touchy π ββοΈ-l,--selector=""β selector (label query) to filter on, supports'=','==','!=','in','notin'. e.g.-l key1=value1,key2=value2,key3 in (value3). matching objects must satisfy all of the specified label constraints β everybody has to agree, it's a group decision π--show-managed-fields=falseβ if true, keep themanagedFieldswhen printing objects in JSON or YAML format. only then. only those formats.--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]. go read the docs, i believe in you π§--validate="ignore"β must be one of:strict(ortrue),warn,ignore(orfalse). here's the breakdown fr fr:"true"or"strict"will use a schema to validate the input and fail the request if invalid. it'll do server side validation ifServerSideFieldValidationis enabled on the api-server, but will fall back to less reliable client-side validation if it's not. strict is strict, she does not bend π€"warn"will warn about unknown or duplicate fields without blocking the request if server-side field validation is enabled on the API server, and behaves as"ignore"otherwise. she's just looking out for you, gently π₯Ί"false"or"ignore"will not perform any schema validation, silently dropping any unknown or duplicate fields. silent. dropping. gone. be careful bestie π
π OPTIONS INHERITED FROM PARENT COMMANDS π
these came from the parent command, they're like hand-me-downs but make it kubernetes:
--as=""β username to impersonate for the operation. user could be a regular user or a service account in a namespace. dress up as someone else, legally π--as-group=[]β group to impersonate for the operation. this flag can be repeated to specify multiple groups. collect them all.--as-uid=""β UID to impersonate for the operation.--as-user-extra=[]β user extras to impersonate for the operation. this flag can be repeated to specify multiple values for the same key.--cache-dir="/homeless-shelter/.kube/cache"β default cache directory. yes that's the literal path, don't @ me.--certificate-authority=""β path to a cert file for the certificate authority.--client-certificate=""β path to a client certificate file for TLS.--client-key=""β path to a client key file for TLS. π--cluster=""β the name of the kubeconfig cluster to use.--context=""β the name of the kubeconfig context to use.--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. like, actually insecure. i'm not being dramatic, the manpage says it π
β οΈ real talk: this one is genuinely risky, it says "insecure" right there in the name. use with caution, bestie.
--kubeconfig=""β path to the kubeconfig file to use for CLI requests.--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. two ways to say no π«--match-server-version=falseβ require server version to match client version. they have to be twinning or it's not happening π-n,--namespace=""β if present, the namespace scope for this CLI request.--profile="none"β name of profile to capture. one of(none|cpu|heap|goroutine|threadcreate|block|mutex). pick your profile, main character π--profile-output="profile.pprof"β name of the file to write the profile to.--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. zero = infinite patience, she'll wait forever π°οΈ-s,--server=""β the address and port of the Kubernetes API server.--tls-server-name=""β server name to use for server certificate validation. if it's not provided, the hostname used to contact the server is used. default behavior, cute.--token=""β bearer token for authentication to the API server.--user=""β the name of the kubeconfig user to use.--warnings-as-errors=falseβ treat warnings received from the server as errors and exit with a non-zero exit code. warnings get promoted to full problems, glow-up gone wrong π¬
π EXAMPLE π
here's where it gets fun, copy-paste these, they're all literally verbatim:
# Update node 'foo' with a taint with key 'dedicated' and value 'special-user' and effect 'NoSchedule'
# If a taint with that key and effect already exists, its value is replaced as specified
oc adm taint nodes foo dedicated=special-user:NoSchedule
# Remove from node 'foo' the taint with key 'dedicated' and effect 'NoSchedule' if one exists
oc adm taint nodes foo dedicated:NoSchedule-
# Remove from node 'foo' all the taints with key 'dedicated'
oc adm taint nodes foo dedicated-
# Add a taint with key 'dedicated' on nodes having label myLabel=X
oc adm taint node -l myLabel=X dedicated=foo:PreferNoSchedule
# Add to node 'foo' a taint with key 'bar' and no value
oc adm taint nodes foo bar:NoSchedule
see that trailing - on the second and third ones? that's the "remove" energy. minus sign = bye bye taint π and peep the double space in -l myLabel=X dedicated=foo:PreferNoSchedule β yes it's really there in the original, keep it, it's part of the lore.
π SEE ALSO π
oc-adm(1),β the parent page, go say hi to the family π«Ά
π§ HISTORY π§
June 2016 β ported from the Kubernetes man-doc generator. vintage. retro. a classic π
ok that's the whole page bestie, you're officially taint-pilled π β¨ no cap, go taint some nodes responsibly.
Openshift β Openshift CLI User Manuals β OC ADM(1) β June 2016 π that's the source, the manual, and the date, all cozy in a lil sign-off. mwah. π«Ά
π¦ 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