The question comes from the issue: https://github.com/kubernetes/kubectl/issues/717
Kubectl returns information in a table like this:
$ kubectl get replicasets -n kube-system
NAMESPACE NAME DESIRED CURRENT READY AGE
kube-system datadog-657c65b75c 2 2 2 11d
kube-system kube-ops-view-5d8df57fc 1 1 0 33d
To find all deviations in the output without using the json formater, I can execute the command:
grep -v '0 0 0\|1 1 1\|2 2 2\|3 3 3\|4 4 4\|5 5 5'
What grep command can cover all possible cases? The goal is to find any ReplicaSets where DESIRED != CURRENT, CURRENT != READY or DESIRED != READY.