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
| Argument | Description |
|---|---|
<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
| Option | Description |
|---|---|
--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 string | Output format, as kubectl takes it; kubectl’s output is printed, and kx’s own lines go to stderr |
--remove strings | Taint to remove, as key or key:Effect (repeatable) |
-y, --yes | Skip the confirmation prompt a NoExecute taint asks |
Passthrough options
| Option | Description |
|---|---|
--allow-missing-template-keys | 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. |
--field-manager string | Name of the manager used to track field ownership. |
--overwrite | If true, allow taints to be overwritten, otherwise reject taint updates that overwrite existing taints. |
--show-managed-fields | If true, keep the managedFields when printing objects in JSON or YAML format. |
--template string | 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[=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
| Option | Description |
|---|---|
--no-color | Disable styled output |
-h, --help | Show 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