You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many admin operations are made easier by fetching a list of the names of things, e.g. into a shell variable. See below for an example. Rather than hacking up a template, asking for just the names should be a normal flag.
% nodes=$(kubectl get nodes -lfoo=bar -otemplate --template='{{range .items}}{{.metadata.name}} {{end}}')
% for node in $nodes; do
for> echo $node
for> done
# Sanity check before beginning work.
% echo $nodes | wc -w
4
% for node in $nodes; do
for> kubectl drain --force $node
for> maintenance_script $node
for> kubectl undrain $node
for> sleep 900
for> done
The text was updated successfully, but these errors were encountered:
Many admin operations are made easier by fetching a list of the names of
things, e.g. into a shell variable. See below for an example. Rather than
hacking up a template, asking for just the names should be a normal flag.
% nodes=$(kubectl get nodes -lfoo=bar -otemplate --template='{{range .items}}{{.metadata.name}} {{end}}')
% for node in $nodes; do
for> echo $node
for> done
Sanity check before beginning work.
% echo $nodes | wc -w
4
% for node in $nodes; do
for> kubectl drain --force $node
for> maintenance_script $node
for> kubectl undrain $node
for> sleep 900
for> done
—
Reply to this email directly or view it on GitHub #16700.
Many admin operations are made easier by fetching a list of the names of things, e.g. into a shell variable. See below for an example. Rather than hacking up a template, asking for just the names should be a normal flag.
The text was updated successfully, but these errors were encountered: