# Ansible module for kubectl GET command

**URL:** <https://forum.ansible.com/t/ansible-module-for-kubectl-get-command/31459>\
**Category:** AWX Project\
**Tags:** kubernetes\
**Created:** [October 11, 2019, 3:04pm UTC](https://forum.ansible.com/t/ansible-module-for-kubectl-get-command/31459 "2019-10-11T15:04:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Boa\_Ah](https://avatars.discourse-cdn.com/v4/letter/b/8baadc/32.png) [@Boa\_Ah](https://forum.ansible.com/u/Boa_Ah)\
**Post date:** [October 11, 2019, 3:04pm UTC](https://forum.ansible.com/t/ansible-module-for-kubectl-get-command/31459/1 "2019-10-11T15:04:33Z")

</div>

Team,

Is there a K8s kubectl module that does all the get commands ? Below one does not show ifnit does kubectl get..

[https://docs.ansible.com/ansible/latest/modules/k8s\_module.html](https://docs.ansible.com/ansible/latest/modules/k8s_module.html)

---

<div class="post-metadata">

**Author:** ![kdelee](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kdelee/32/193_2.png) [@kdelee](https://forum.ansible.com/u/kdelee)\
**Post date:** [October 11, 2019, 5:24pm UTC](https://forum.ansible.com/t/ansible-module-for-kubectl-get-command/31459/2 "2019-10-11T17:24:44Z")

</div>

Have you taken a look at this lookup plugin?

[https://docs.ansible.com/ansible/latest/plugins/lookup/k8s.html?highlight=k8s](https://docs.ansible.com/ansible/latest/plugins/lookup/k8s.html?highlight=k8s)

---

<div class="post-metadata">

**Author:** ![Boa\_Ah](https://avatars.discourse-cdn.com/v4/letter/b/8baadc/32.png) [@Boa\_Ah](https://forum.ansible.com/u/Boa_Ah)\
**Post date:** [October 11, 2019, 6:58pm UTC](https://forum.ansible.com/t/ansible-module-for-kubectl-get-command/31459/3 "2019-10-11T18:58:54Z")

</div>

Nice. Thanks!

AhmedFarooqi

---

<div class="post-metadata">

**Author:** ![Boa\_Ah](https://avatars.discourse-cdn.com/v4/letter/b/8baadc/32.png) [@Boa\_Ah](https://forum.ansible.com/u/Boa_Ah)\
**Post date:** [October 15, 2019, 7:27pm UTC](https://forum.ansible.com/t/ansible-module-for-kubectl-get-command/31459/4 "2019-10-15T19:27:05Z")

</div>

can you clarify what Authentication this module needs to run? I have admin kubeconfig file but does how to let this module use it to talk to cluster?

---

<div class="post-metadata">

**Author:** ![Boa\_Ah](https://avatars.discourse-cdn.com/v4/letter/b/8baadc/32.png) [@Boa\_Ah](https://forum.ansible.com/u/Boa_Ah)\
**Post date:** [October 15, 2019, 7:27pm UTC](https://forum.ansible.com/t/ansible-module-for-kubectl-get-command/31459/5 "2019-10-15T19:27:38Z")

</div>

can you clarify what Authentication this module needs to run? I have admin kubeconfig file but does not how to let this module use it to talk to cluster.

---

<div class="post-metadata">

**Author:** ![kdelee](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kdelee/32/193_2.png) [@kdelee](https://forum.ansible.com/u/kdelee)\
**Post date:** [October 16, 2019, 1:42pm UTC](https://forum.ansible.com/t/ansible-module-for-kubectl-get-command/31459/6 "2019-10-16T13:42:15Z")

</div>

Open to correction, but I think that at the moment the best route would probably be to create a Custom Credential Type [https://github.com/ansible/awx/blob/devel/docs/credentials/custom\_credential\_types.md#custom-credential-types-overview](https://github.com/ansible/awx/blob/devel/docs/credentials/custom_credential_types.md#custom-credential-types-overview) and then create a Credential of that type that would inject the information you need into your job environment.
