Comments (6)
Bash - slow:
https://github.com/ahmetb/kubectx/releases/download/v0.9.5/kubectx
Native binary - fast:
https://github.com/ahmetb/kubectx/releases/download/v0.9.5/kubectx_v0.9.5_darwin_arm64.tar.gz
from kubectx.
Before we go into Bash vs Go implementations, I assume you use the bash script-based implementation?
Does "kubectl config list-contexts" also take 3s?
If that's the case let's try to figure out why, as it'll impact your shell completion time regardless of kubectx implementation.
from kubectx.
I couldn't find kubectl config list-contexts
, but did find kubectl config get-contexts
. kubectl config get-contexts
was slow
. I found I was using kubectl
from rancher-desktop
. When I moved rancher-desktop
's bin
directory from the beginning of the PATH
to the end up the PATH
it became fast
. The reason is that I was then using kubectl
from brew
.
Update: Upgrading rancher-desktop
helped by 100%
, but its kubectl
is still between 280%
slower and 600%
slower.
from kubectx.
Kubectl shouldn't take a second to list contexts. Feel free to add -v=10 flag to see where the time is spent. Regardless, it doesn't seem the issue is with this tool.
If it turns out kubectl is unnecessarily slow, you can file an issue in kubectl repo. It might be a regression.
from kubectx.
@ahmetb My question is why have a bash
version and a native binary
version? I could make arguments for both, but having both seems redundant
.
from kubectx.
@edgan this is not really the place to debate that :) many distros still package and distribute the shell version.
Go version works on Windows, and has some other benefits like it can preserve kubeconfig file structure/comments while changing contexts. But it has some poor handling around multiple KUBECONFIGs joined (:) and auth providers that write back to kubeconfig file after authentication.
So for some users the shell has the most backwards compatibility as it shells out to kubectl. Whereas most users are probably fine with Go implementation.
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
- 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.