Skip to content

kx taint

Sets or removes taints on one indexed Node — key=value:Effect or key:Effect to set, --remove to drop one. The effect is NoSchedule, PreferNoSchedule or NoExecute.

One index only, as for kx drain: a NoExecute taint evicts every Pod that does not tolerate it, so tainting a range of Nodes in one command drains each of them. Setting one asks first, unless you pass --yes.

kubectl’s own taint flags pass through, --overwrite and --dry-run among them. --all and --selector are refused, since beside a Node’s name kubectl taint applies them to every Node they select.

A flag kx doesn’t know is refused; put it after -- to pass it through to kubectl.

Usage

kx taint [OPTIONS] <index> [taint...] [kubectl flags]

Arguments

ArgumentDescription
<index>Row number from the current listing, @name for a mark, or kind/name such as deploy/api
[taint]...A taint to set, key=value:Effect or key:Effect; repeatable

Options

OptionDescription
--dry-run[=string]client or server to preview the change without making it, as kubectl takes it; kx’s line says nothing was changed
-o, --output stringOutput format, as kubectl takes it; kubectl’s output is printed, and kx’s own lines go to stderr
--remove stringsTaint to remove, as key or key:Effect (repeatable)
-y, --yesSkip the confirmation prompt a NoExecute taint asks

Passthrough options

OptionDescription
--allow-missing-template-keysIf 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.
--field-manager stringName of the manager used to track field ownership.
--overwriteIf true, allow taints to be overwritten, otherwise reject taint updates that overwrite existing taints.
--show-managed-fieldsIf true, keep the managedFields when printing objects in JSON or YAML format.
--template stringTemplate 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[=string]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.
…kubectl’s global flags too: --context, --kubeconfig, --as and the rest; kubectl options lists them

Global options

OptionDescription
--no-colorDisable styled output
-h, --helpShow this message and exit

Examples

kx taint 1 dedicated=gpu:NoSchedule
kx taint 1 --remove dedicated
kx taint 1 maintenance:NoExecute -y
kx taint 1 dedicated=infra:NoSchedule --overwrite
kx taint 1 maintenance:NoExecute --dry-run=server