KUBERNETES(1)(kubernetes)

πŸ’… NAME πŸ’…

okay so bestie, this is kubectl taint β€” the lil command that updates the taints on one or more nodes. that's it, that's the whole job. and yes it's from the kubernetes manual, the big one, KUBERNETES(1)(kubernetes). we're in kubectl territory, so put your lanyard on and let's go 🌸


✨ SYNOPSIS ✨

kubectl taint [OPTIONS]

short. sweet. iconic. she doesn't need a whole novel to introduce herself πŸ’–


πŸ¦‹ DESCRIPTION πŸ¦‹

Update the taints on one or more nodes. that's the mission, that's the vibe, no cap.

  • A taint consists of a key, value, and effect. As an argument here, it is expressed as key=value:effect.
  • The key must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to 253 characters.
  • Optionally, the key can begin with a DNS subdomain prefix and a single '/', like example.com/my-app.
  • The value is optional. If given, it must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to 63 characters.
  • The effect must be NoSchedule, PreferNoSchedule or NoExecute.
  • Currently taint can only apply to node.

so like, taints are little "ew don't schedule pods here unless you're cool with it" stickers, and the format is strict about how you write them. memorize the shape or the command will simply not eat πŸ“


πŸ‘‘ OPTIONS πŸ‘‘

  • --all=false β€” select all nodes in the cluster. yes, ALL of them. the whole friend group πŸ’€
  • --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.
  • --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 window shopping πŸ›οΈ
  • --field-manager="kubectl-taint" β€” name of the manager used to track field ownership.
  • -o, --output="" β€” output format. One of: (json, yaml, kyaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).
  • --overwrite=false β€” if true, allow taints to be overwritten, otherwise reject taint updates that overwrite existing taints. lowkey a safety rail, don't touch it unless you mean it πŸ™ˆ
  • -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.
  • --show-managed-fields=false β€” if true, keep the managedFields when printing objects in JSON or YAML format.
  • --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].
  • --validate="strict" β€” must be one of: strict (or true), warn, ignore (or false). "true" or "strict" will use a schema to validate the input and fail the request if invalid. It will perform server side validation if ServerSideFieldValidation is enabled on the api-server, but will fall back to less reliable client-side validation if not. "warn" will warn about unknown or duplicate fields without blocking the request if server-side field validation is enabled on the API server, and behave as "ignore" otherwise. "false" or "ignore" will not perform any schema validation, silently dropping any unknown or duplicate fields.

🌈 OPTIONS INHERITED FROM PARENT COMMANDS 🌈

these are the family heirlooms, passed down from the parent kubectl command. she didn't invent them, she just inherited them πŸ’œ

  • --as="" β€” username to impersonate for the operation. User could be a regular user or a service account in a namespace.
  • --as-group=[] β€” group to impersonate for the operation, this flag can be repeated to specify multiple groups.
  • --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="/home/username/.kube/cache" β€” default cache directory
  • --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
  • --insecure-skip-tls-verify=false β€” if true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. ok so this one is actually dangerous, don't just casually turn it on for the aesthetic, 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 exporting KUBECTL_KUBERC=false feature gate or turning off the feature KUBERC=off.
  • --match-server-version=false β€” require server version to match client version
  • -n, --namespace="" β€” if present, the namespace scope for this CLI request
  • --password="" β€” password for basic authentication to the API server
  • --profile="none" β€” name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex|trace)
  • --profile-output="profile.pprof" β€” name of the file to write the profile to
  • --proxy-url="" β€” proxy URL to use for requests to the API server
  • --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.
  • -s, --server="" β€” the address and port of the Kubernetes API server
  • --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
  • --token="" β€” bearer token for authentication to the API server
  • --user="" β€” the name of the kubeconfig user to use
  • --username="" β€” username for basic authentication to the API server
  • --version=false β€” --version, --version=raw prints version information and quits; --version=vX.Y.Z... sets the reported version
  • --warnings-as-errors=false β€” treat warnings received from the server as errors and exit with a non-zero exit code

πŸŽ€ EXAMPLE πŸŽ€

the receipts, the lore, the demonstrations. copy these EXACTLY, they are the blueprint ✨

# 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
kubectl taint nodes foo dedicated=special-user:NoSchedule

# Remove from node 'foo' the taint with key 'dedicated' and effect 'NoSchedule' if one exists
kubectl taint nodes foo dedicated:NoSchedule-

# Remove from node 'foo' all the taints with key 'dedicated'
kubectl taint nodes foo dedicated-

# Add a taint with key 'dedicated' on nodes having label myLabel=X
kubectl taint node -l myLabel=X  dedicated=foo:PreferNoSchedule

# Add to node 'foo' a taint with key 'bar' and no value
kubectl taint nodes foo bar:NoSchedule

the lil trailing dash at the end of a taint spec? that's the "remove this" button. so dedicated:NoSchedule- means bye bye that exact taint, and dedicated- means bye bye everything with that key. iykyk πŸ’…


πŸ’– SEE ALSO πŸ’–


πŸ“œ HISTORY πŸ“œ

January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since!


and that's the whole page, bestie 🫢 this was the KUBERNETES(1)(kubernetes) manual, straight from the Manuals / User shelf β€” written by Eric Paris back in Jan 2015 and still out here living her truth. now go taint a node, you absolute icon πŸ‘‘βœ¨

πŸ“¦ where this page comes from