I want to get the list of active nodes using kubectl. Is there a flag to do this. At the moment, I am just running
kubectl get node
You can do this
kubectl get nodes | grep Ready
or you can do this
JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}
{@.type}={@.status};{end}{end}' \
&& kubectl get nodes -o jsonpath="$JSONPATH" | grep "Ready=True"