Comments (6)
I believe this is a WONTFIX for now.
from kubectx.
kubens just calls kubectl config set-context [CURRENT_CTX] --namespace=[NS]
to update the current context with the specified namespace.
If you call kubens NAME
with a NAME that you have access to, it should work?
You can do some surgery by editing ~/.kube/config, but I'm not exactly sure if that's what you want.
from kubectx.
I was able to duplicate the issue. The way I resolved it was by setting the users.user.auth-provider.config.expiry
to a date in the past in ~/.kube/config
. I guess the gcloud cli caches the authenticated user for period of time and kubens just uses the current user.
If you call kubens NAME with a NAME that you have access to, it should work?
It didn't work.
from kubectx.
You're right. It looks like we are looking up all namespaces to see if the namespace we're trying to switch to exists.
We need this because I don't want people to be run kubens NAME
with a typo in the NAME and then get some weird error from kubectl.
kubectl config set-context --namespace
does not validate this, but kubens
does.
We might do a kubectl get namespace NAME
instead of listing via kubectl get namespaces
to check existence.
But that's tricky. We'd need to rely on the output message of kubectl get namespace NAME
and look for NotFound
to tell if the command failed due to some other reason, or whether namespace doesn't exist.
Can you test if kubectl get namespace NAME
works with a namespace you have access to? I'm not sure if your (and other people's) RBAC allows "get" on namespace.
from kubectx.
paul in ~
$ kctx CONTEXT-I-DONT-HAVE-ACCESS-TO-WITH-CURRENT-GCLOUD-USER
Switched to context "CONTEXT-I-DONT-HAVE-ACCESS-TO-WITH-CURRENT-GCLOUD-USER".
paul in ~
$ kubectl get namespace NAMESPACE_NAME
Error from server (Forbidden): namespaces "NAMESPACE_NAME" is forbidden: User "EMAIL-ADDRESS" cannot get namespaces in the namespace "NAMESPACE_NAME": Required "container.namespaces.get" permission.
from kubectx.
yeah I'm afraid without container.namespaces.get
we can't perform this check and I want to keep that check in kubens
. π
from kubectx.
Related Issues (20)
- Are go versions still considered not stable? HOT 2
- kubie and kubens mixed cause kubeconfig syntax error HOT 12
- Canβt use `--height` in fzf options on Windows HOT 2
- blank issue HOT 1
- Add --selector option to kubens HOT 1
- Feature Request: Use kubectx to use right version of kubectl binary for a given K8s cluster HOT 1
- `kubens` fails with `invalid apiVersion "client.authentication.k8s.io/v1"` but `kubectl` works normally HOT 2
- Vulnerability of dependency "golang.org/x/net" HOT 1
- Add completions for Nushell
- Add kubectl plugin installation to Homebrew formula HOT 4
- [Go] kubens not working with in-cluster config HOT 1
- show all of NAME, CLUSTER and AUTHINFO in cluster selection list HOT 2
- Allow customizing path to KUBECTX and KUBENS_DIR
- Homebrew install makes kubectx slow HOT 6
- Shell completions (for zsh) fail for kubectx if its binary is renamed to kx HOT 1
- Autocomplete does not work when installed as Krew plugin HOT 2
- Autocomplete breaks when multiple longer contexts match HOT 2
- kubectl ctx outputs code lines start with plus sign + HOT 1
- error: open /home/myuser/.kube/config: permission denied HOT 1
- Consider open up internal packages HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kubectx.