-
Notifications
You must be signed in to change notification settings - Fork 192
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 get status of pods? #16
Comments
@DivyaYash that short hand is useful when you want to get pods associated with a specific replication controller. For example,
You can see what pods are running be inspecting that result:
|
Getting a Type error.. |
can you post the code you're running? |
Just copied urs and trying...am very new, do not know much .. k8.namespaces.replicationcontrollers.pod.get(print); |
Change this line:
to include the name of the replication controller you're interested in. For example, if you want to get all pods associated with your replication controller named 'foo-rc', you'd do:
If you're interested in getting status for all the Pods in a namespace, just do:
|
Thanks for the quick response, I am interested in status of all pods, I tried as you suggested, but getting error - const statuses = result.item.map(pod => pod.status); TypeError: Cannot read property 'map' of undefinedvar fs = require('fs'); function print(err, result) { |
Also, where can I know on "how to construct below calls"? which documentation I need to refer? |
sorry, I typoed:
(notice For general JavaScript reference there's MDN For Kubernetes API documentation there's the Kubernetes Docs. E.g., here's the definition of the PodList which is the thing we're operating on above: http://kubernetes.io/docs/api-reference/v1/definitions/#_v1_podlist Since this is more of JavaScript help question and less specific to |
Ok, thanks for your help, it worked! |
When I do a k8.namespaces.replicationcontrollers.pod.get(print); Its a very long o/p..I am interested in knowing if the pod is in "Running" status or not..How can I fetch this information?
Please help!
The text was updated successfully, but these errors were encountered: