-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
K8s ignore kubeconfig file and connects to localhost when in a kubernetes cluster #72769
Comments
Files identified in the description: If these files are incorrect, please update the |
!component =lib/ansible/modules/clustering/k8s/k8s.py |
Files identified in the description:
If these files are incorrect, please update the |
Thank you very much for your interest in Ansible. Ansible has migrated much of the content into separate repositories to allow for more rapid, independent development. We are closing this issue/PR because this content has been moved to one or more collection repositories.
For further information, please see: |
Hello, What do i need to change ? |
Open this issue in https://github.com/ansible-collections/community.kubernetes/issues. |
Hello @FlorianJDF |
Hi @sergiosamu Yes I did. Warning, I was using the openshift 0.11.2 lib that before installed the kubernetes 11 lib, but now installs the kubernetes 12 lib. I hope this helps you, |
Hello!
Thanks for your tips.
Switching to kubernetes 11.0.0 and openshift 0.11.0 solved the issue.
Best.
…On Sat, Dec 5, 2020, 11:23 Florian Teissedre ***@***.***> wrote:
Hi @sergiosamu <https://github.com/sergiosamu>
Yes I did.
If fact ansible <= 2.9 do not work with the python kubertes lib > 11.0.0.
So if like me you are using rhel, so ansible 2.10 is not supported, you
need to use kubernetes==11.0.0.
Warning, I was using the openshift 0.11.2 lib that before installed the
kubernetes 11 lib, but now installs the kubernetes 12 lib.
I hope this helps you,
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#72769 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADREFBTIBNVURPXGYUMHVS3STIC3PANCNFSM4UI2FGMQ>
.
|
SUMMARY
Hello all,
I'm trying to use an ansible playbook with the k8s module inside a container started by tekton on a kubernetes cluster.
In this container I have a kubeconfig file that is working (kubectl commands works)
When running the playbook, the K8S modules tries to connect to "localhost:80" instead of the URL provided in the kubeconfig file.
When changing the env var K8S_AUTH_HOST, the playbook tries to connect to the URL declared in the env var K8S_AUTH_HOST.
Look like for some reason the module is ignoring the "context" and "kubeconfig" input.
But if one of them is wrong (no kubeconfig file or wrong context for example) the playbook fails.
Using the same playbook on a local linux machine works perfectly.
ISSUE TYPE
COMPONENT NAME
community.kubernetes.k8s
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Container ubi7 with ansible and python installed
STEPS TO REPRODUCE
Using this playbook
EXPECTED RESULTS
The K8s module checking on the cluster https://api-test-env.maint.com:6443 with the context and kubeconfig declared
ACTUAL RESULTS
The K8s modules failed tying to conect to localhost:80
The text was updated successfully, but these errors were encountered: