ansible-collections / kubernetes.core

The collection includes a variety of Ansible content to help automate the management of applications in Kubernetes and OpenShift clusters, as well as the provisioning and maintenance of clusters themselves.
Other
215 stars 135 forks source link

kubectl top pods Command #487

Open silvermind opened 2 years ago

silvermind commented 2 years ago
SUMMARY

Is it currently possible to run commands like this and collect the value in an ansible variable?

kubectl top pods --containers --namespace=my-namespace
kubectl top pods --containers -A
kubectl top pods -A --sort-by=cpu
kubectl top pods -A --sort-by=memory
ISSUE TYPE
COMPONENT NAME

https://github.com/ansible-collections/kubernetes.core#modules

ANSIBLE VERSION

2.12

Akasurde commented 2 years ago

@silvermind Thanks for reporting this issue. You can use shell or command module to invoke kubectl commands. Right now, we do not have any module specifically for kubectl.