Skip to content
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

Set default namespace in a session #77

Open
mitchellmaler opened this issue Aug 12, 2020 · 3 comments
Open

Set default namespace in a session #77

mitchellmaler opened this issue Aug 12, 2020 · 3 comments

Comments

@mitchellmaler
Copy link

mitchellmaler commented Aug 12, 2020

Today you have to set the namespace when you start the session or specify it each command. It would be create to be able to switch the namespace or even the context while in a session.

Example proposal

!namespace "namespace autocomplete"
!ns "namespace autocomplete"
@melkamar
Copy link

Today you have to set the namespace when you start the session

How do you set the namespace to use when starting the session?

@zzeebbii
Copy link

@mitchellmaler I'd also like to know how can you set the default namespace before starting the session. I see that the tool accepts the command line argument to set the default namespace but it doesn't work for me somehow. I've tried all the following combinations.

kube-prompt --namespace "my-namespace"
kube-prompt --namespace="my-namespace"
kube-prompt -n "my-namespace"
kube-prompt -n="my-namespace"

But when I get the pods using the get pods command, it only shows the pods from the default namespace only. If I use get pods -n my namespace then it shows the pods from the namespace. Somehow it is not setting a different namespace from the beginning.

@kaime
Copy link

kaime commented Jun 16, 2022

I'd also like to see it implemented as a command-line option.

I'm currently running kube-prompt inside a Docker container. My workaround is executing this command before kube-prompt:

kubectl config set-context --current --namespace=WHATEVER

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants