-
Notifications
You must be signed in to change notification settings - Fork 71
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
Example in the README will not run because of "pods is forbidden" #42
Comments
The example uses a method
Try to check if kubectl can list all pods. It looks like your user |
Yes, I can run Why is it using |
It seems like the bug. Could you provide some details from |
Yes, here are the contents, after removing all the extra clusters: apiVersion: v1
clusters:
- cluster:
insecure-skip-tls-verify: true
server: https://localhost:6443
name: docker-for-desktop-cluster
contexts:
- context:
cluster: docker-for-desktop-cluster
namespace: asyncy-system
user: docker-for-desktop
name: docker-for-desktop
current-context: docker-for-desktop
kind: Config
preferences: {}
users:
- name: docker-for-desktop
user:
client-certificate-data: ...
client-key-data: ... |
Looks good. Is it possible that one of the extra clusters from you kubeconfig has the same name? There was such issue in the official library and probably it's not ported yet kubernetes-client/python#445 Could you check if the official synchronous client has the same problem? Thanks. |
I ran this example in a clean venv, and it worked. I also checked if I had any duplicates, and I do not have any. |
Any way I can turn on extreme debugging in your client? |
I'm afraid there are not debug logs. I've compared these libraries and I can't find any significant differences... Can I try to recreate your environment? Is |
Yes, it's a k8s cluster started by docker on macOS 10.13.6. |
Unfortunately I don't have access to macOS. I added debug logs (#45) which may help. Could you check this code? import asyncio
import logging
from kubernetes_asyncio import client, config
async def main():
await config.load_kube_config()
v1 = client.CoreV1Api()
print("Listing pods with their IPs:")
ret = await v1.list_pod_for_all_namespaces()
for i in ret.items:
print(i.status.pod_ip, i.metadata.namespace, i.metadata.name)
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close() |
@tomplus Here's what the output is:
|
I've check code again and it looks like the problem is caused by this settings The verify_ssl, ssl_context, fingerprint and ssl parameters are mutually exclusive in aiohttp, so this library won't pass certs if you unset verify_ssl... I can change the behavior after your confirmation. If certs are provider this |
@tomplus We're making some progress here - after removing
Perhaps the interpretation of that flag is incorrect in the library? |
Fixed! Now this flag impacts on server verification only. Thanks for your patience :) |
Thank you so much @tomplus! I can verify that it's working well now. |
I'm running the example in the README for the repo, and I cannot get it to work:
If the client is supposed to read the default kube config (which I think it does), it somehow cannot authenticate correctly. Is this a bug? Or is my usage incorrect?
The text was updated successfully, but these errors were encountered: