-
Notifications
You must be signed in to change notification settings - Fork 133
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
add an example to the kubectl plugin #288
Conversation
recheck |
|
||
tasks: | ||
- name: Get the phpmyadmin Pod name. | ||
command: > |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @tpo. Instead of using kubectl
here, can you instead use the kubernetes.core.k8s_info
module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gravesm wrote:
Instead of using kubectl here, can you instead use the kubernetes.core.k8s_info module?
I'd like to. I just spent 90 minutes trying to get a simple k8s_info
task to run to no avail. Same as with the kubectl plugin: the examples in the k8s_info
docu are too dire to allow me to get it to work.
- Either
k8s_info
tries to first connect to the master node via ssh and access the k8s API there, which fails, because the credentials to access the API are not available on the node because my management machine is my own PC and not the master node. - Or I am trying to get accessing the API from my local PC to work:
- hosts: master-node
tasks:
- local_action:
module: k8s_info
kind: Pod
context: my_cluster
# the following line doesn't seem to have any impact -
# ansible will still try to connect to the k8s API on localhost
# kubeconfig: /home/myself/.kube/config
become: no
register: pod_list
- debug: var=pod_list
but am failing because for whatever reason, k8s_info
is not accessing my default ~/.kube/config but instead trying to connect to the k8s API at localhost, which obviously fails, because localhost is not in fact a k8s cluster. Nota bene I'm running ansible 2.10 on Debian bullseye here.
So for the time being I'm stopping trying to get k8s_info to work and instead returning to my usual paid job duties again.
That means there are the following ways forward for me with this ticket:
- a) I get help on how to get
k8s_info
to work - b) at some undefined time in the future I again take some time off from my normal schedule and try to resolve this twisted
k8s_info
mystery - c) we leave the example as is
- d) I drop the retrieval of pod names from the example (which will obviously make it much less useful - because pod names are usually ephemeral) and put a static pod name into the example instead
- e) we scratch this pull request
- f) some other idea
What do you think? Do you have help or a suggestion on how to proceed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately it seems that I am unable to reserve myself time for option b) above during the coming 3 weeks or so. Any opinions on unstalling this pull request with either choice of a) c) d) e) or f) from above?
recheck |
2 similar comments
recheck |
recheck |
I have experience with |
Thank you, please do |
Thanks a lot for your very nice examples @yurnov - I have reviewed your pull request. If there's some formal syntax to tag your pull request as reviewed by myself then let me know and I can add that as well. Thanks again, very appreciated! |
Doc: add example of using kubectl connection plugin SUMMARY Currently documentation for collection don't include any examples of using kubenrenes.core.kubectl connection plugin and it's hard to start using that plugin. ISSUE TYPE Docs Pull Request COMPONENT NAME kubenrenes.core.kubectl connection plugin ADDITIONAL INFORMATION This PR was inspired by #288 and based on feedback on that PR and my own experience. Thanks @tpo for his try and @geerlingguy for his Ansible for DevOps book Reviewed-by: Bikouo Aubin Reviewed-by: Sandra McCann <samccann@redhat.com> Reviewed-by: Mike Graves <mgraves@redhat.com> Reviewed-by: Yuriy Novostavskiy Reviewed-by: purdzan
Doc: add example of using kubectl connection plugin SUMMARY Currently documentation for collection don't include any examples of using kubenrenes.core.kubectl connection plugin and it's hard to start using that plugin. ISSUE TYPE Docs Pull Request COMPONENT NAME kubenrenes.core.kubectl connection plugin ADDITIONAL INFORMATION This PR was inspired by #288 and based on feedback on that PR and my own experience. Thanks @tpo for his try and @geerlingguy for his Ansible for DevOps book Reviewed-by: Bikouo Aubin Reviewed-by: Sandra McCann <samccann@redhat.com> Reviewed-by: Mike Graves <mgraves@redhat.com> Reviewed-by: Yuriy Novostavskiy Reviewed-by: purdzan (cherry picked from commit fb80d97)
Doc: add example of using kubectl connection plugin SUMMARY Currently documentation for collection don't include any examples of using kubenrenes.core.kubectl connection plugin and it's hard to start using that plugin. ISSUE TYPE Docs Pull Request COMPONENT NAME kubenrenes.core.kubectl connection plugin ADDITIONAL INFORMATION This PR was inspired by #288 and based on feedback on that PR and my own experience. Thanks @tpo for his try and @geerlingguy for his Ansible for DevOps book Reviewed-by: Bikouo Aubin Reviewed-by: Sandra McCann <samccann@redhat.com> Reviewed-by: Mike Graves <mgraves@redhat.com> Reviewed-by: Yuriy Novostavskiy Reviewed-by: purdzan (cherry picked from commit fb80d97)
[PR #741/fb80d973 backport][stable-3] Doc: add example of using kubectl connection plugin This is a backport of PR #741 as merged into main (fb80d97). SUMMARY Currently documentation for collection don't include any examples of using kubenrenes.core.kubectl connection plugin and it's hard to start using that plugin. ISSUE TYPE Docs Pull Request COMPONENT NAME kubenrenes.core.kubectl connection plugin ADDITIONAL INFORMATION This PR was inspired by #288 and based on feedback on that PR and my own experience. Thanks @tpo for his try and @geerlingguy for his Ansible for DevOps book Reviewed-by: Yuriy Novostavskiy Reviewed-by: Mike Graves <mgraves@redhat.com>
[PR #741/fb80d973 backport][stable-5] Doc: add example of using kubectl connection plugin This is a backport of PR #741 as merged into main (fb80d97). SUMMARY Currently documentation for collection don't include any examples of using kubenrenes.core.kubectl connection plugin and it's hard to start using that plugin. ISSUE TYPE Docs Pull Request COMPONENT NAME kubenrenes.core.kubectl connection plugin ADDITIONAL INFORMATION This PR was inspired by #288 and based on feedback on that PR and my own experience. Thanks @tpo for his try and @geerlingguy for his Ansible for DevOps book Reviewed-by: Mike Graves <mgraves@redhat.com>
SUMMARY
When looking at the kubectl plugin documentation I have no idea how to use the plugin. Having and example helps a lot. Please include an example such as the provided one. Thanks a lot for writing the plugin in the first place!
ISSUE TYPE
COMPONENT NAME
kubectl