Skip to content

kubernetes.config.config_exception.ConfigException: Invalid kube-config file. Expected key users in kube-config #236

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

Closed
sidd14491 opened this issue May 26, 2017 · 14 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@sidd14491
Copy link

After installing Kubernets package used the script to list of all pods.
But After running the script I am observing following error.
File "1.py", line 4, in
config.load_kube_config()
File "build/bdist.linux-x86_64/egg/kubernetes/config/kube_config.py", line 311, in load_kube_config
File "build/bdist.linux-x86_64/egg/kubernetes/config/kube_config.py", line 282, in _get_kube_config_loader_for_yaml_file
File "build/bdist.linux-x86_64/egg/kubernetes/config/kube_config.py", line 118, in init
File "build/bdist.linux-x86_64/egg/kubernetes/config/kube_config.py", line 134, in set_active_context
File "build/bdist.linux-x86_64/egg/kubernetes/config/kube_config.py", line 253, in getitem
kubernetes.config.config_exception.ConfigException: Invalid kube-config file. Expected key users in kube-config

@mbohlool
Copy link
Contributor

does kubectl works? can you share redacted kube config file content at ~/.kube/config?

@sidd14491
Copy link
Author

apiVersion: v1
clusters:

  • cluster:
    server: http://10.213.18.39:8080
    name: test
    contexts:
  • context:
    cluster: test
    user: test
    name: test
    Yes Kubectl command is working fine
    Below the o/p of command
    root@csp-central-ms-vm1839:~/REQUESTS# kubectl get pods
    NAME READY STATUS RESTARTS AGE
    csp.admin-portal-ui-346402271-qnuw8 1/1 Running 0 24d
    csp.ams-2611059999-cypjx 1/1 Running 0
    24d

@pokoli
Copy link

pokoli commented Jun 5, 2017

I uploaded a PR that should fix this issue, could you test please?

@mbohlool
Copy link
Contributor

mbohlool commented Jun 5, 2017

I commented on your (merged) PR. I think it is in the right direction but needs more fixes. It may fix @sidd14491 issue (sidd14491 can you confirm?) but need to fix this for all cases where user is missing.

@sidd14491
Copy link
Author

For verification which build I need to take.
Can you mention the build location from where I'll take the fixed version and tested my scenario..
Thanks.
Siddharth

@pokoli
Copy link

pokoli commented Jun 6, 2017

You have to install the latest version from sources. The following commands will do:

git clone --recursive [email protected]:kubernetes-incubator/client-python.git
cd client-python/kubernetes/base
git checkout master
cd ../..
python setup.py install

Then you can execute an example script with your client config. The following command will load the default context of your kube.cfg:

python -m examples.example1

@pokoli
Copy link

pokoli commented Jun 6, 2017

@mbohlool before closing this PR I think that we must update the git submodule to a revision that includes all the fixes. What do you think?

@mbohlool
Copy link
Contributor

mbohlool commented Jun 6, 2017 via email

@pokoli
Copy link

pokoli commented Jun 7, 2017

I'm waiting for kubernetes-client/python-base#5 to be merged before updating submodules.

For now we should keep the issue open. Can you reopen please?

@mbohlool mbohlool reopened this Jun 7, 2017
pokoli pushed a commit to pokoli/client-python that referenced this issue Jun 9, 2017
pokoli pushed a commit to pokoli/client-python that referenced this issue Jun 12, 2017
@sidd14491
Copy link
Author

sidd14491 commented Jun 16, 2017 via email

@pokoli
Copy link

pokoli commented Jun 16, 2017

@sidd14491 I don't see how your question is related to the current thread. Can you open a new issue please?

@sidd14491
Copy link
Author

sidd14491 commented Jun 16, 2017 via email

@pokoli
Copy link

pokoli commented Jun 16, 2017

So please open a new issue for different questions....

@scottprichard
Copy link

of course this is closed.

yliaog pushed a commit to yliaog/client-python that referenced this issue Jan 8, 2022
dudleyhunt86 added a commit to dudleyhunt86/python-base-repository-build that referenced this issue Oct 7, 2022
bh717 pushed a commit to bh717/python-dapp that referenced this issue Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

4 participants