Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to find all ReplicaSets that have not enough running replicas? #717

Closed
kivagant-ba opened this issue Sep 13, 2019 · 1 comment
Closed

Comments

@kivagant-ba
Copy link

kivagant-ba commented Sep 13, 2019

Right now I'm using the trick to find all replicasets that have DESIRED bigger than 0 but zero CURRENT or READY pods:

kubectl get rs --all-namespaces  |grep -v '0         0         0'|grep ' 0 '

This is not perfect since it actually loads all replicasets and then filter them using unreliable way. Also the command won't show the situation when DESIRED = 2 but RUNNING = 1. I would like to get all ReplicaSets that have any problems using kubectl only without external monitoring systems.

Is this possible and how to do that?

Thank you.

UP: actually, the same question is actual for deployments and daemonsets (pseudo-output):

kubectl get deployment
NAME                                    DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
blablah                                 2         1         1            1           35d


kubectl get daemonsets -n kube-system
NAME                 DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
kube-proxy           11        11        10      11           10          <none>          179d
@kivagant-ba
Copy link
Author

The answer: https://serverfault.com/a/985578/447077

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant