kubermatic / fubectl Goto Github PK
View Code? Open in Web Editor NEWReduces repetitive interactions with kubectl
License: Apache License 2.0
Reduces repetitive interactions with kubectl
License: Apache License 2.0
Hi all!
Looking for new ideas I found your project. It gave me some ones and I'd like to share my visions with you. Hope it will help you further.
Lines 80 to 85 in 3950b1e
I think the snippet above can be improved a little bit in the way as below. It requires kubectl itself and its jsonpath features that have already been embedded.
kubectl config view --minify \
-o jsonpath="{range .contexts[*].context}{@.user}{\"@\"}{@.cluster}{\":\"}{@.namespace}{\"\n\"}"
It displays the current context in the form similar to the unix prompt like user@cluster:namespace
. It's constructed to be used directly or as an alias. You can take it as is or modify on your wants or drop as a bad idea for your project :).
On Mac with zsh kdes is not working and giving below error. Which script mac user have to -- to -I or something like that ?
(⎈ |minikube:default)➜ hack git:(master) kdes po
xargs: illegal option -- r
usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements]] [-J replstr]
[-L number] [-n number [-x]] [-P maxprocs] [-s size]
[utility [argument ...]]
(⎈ |minikube:default)➜ hack git:(master)
By grepping the source and comparing the README.md content.. I identified that below functions are not mentioned and documented in the README currently.
ka
kwa
kwatch
kcmd
kube_ctx_name
kube_ctx_namespace
kget
kexp
kget-exp
ked
kkonfig
Also we need to remove kdebug from the readme.md since it does not exist anymore in source.
Hello
Currently many aliases are querying resources from all namespaces. In case of big cluster with dozens NS and dozens of pods in evey NS such frequent querying could affect cluster performance and also provide slow response time to end users.
I propose to introduce one of the following
klog
for current namespacekloga
for all namespacesklog
for current behaviour (all NS) and klg
for current NSWdyt ?
There seems to be parsing issues on zsh
with kadd
and kdel
functions:
fubectl.source:69: defining function based on alias `ked'
fubectl.source:69: parse error near `()'
when commented out those functions all is fine
I would like to have default line number for klog -f
so that I don't have to type in how many lines should be in the returned klog 200 -f
it would mirror the behaviour from tail and head as it says in the man page The default starting location is "-n 10", or the last 10 lines of the input
Could you create a first release or tag? I am looking into packaging this for openSUSE, so having tags/releases would be nice...
MicroK8S is Kubernetes Distribution from Canonical packaged as snap
Since MicroK8s uses proxy command (microk8s.kubectl get pods
instead of kubectl get pods
) this would require extracting kubectl
command to own variable and maybe some logic like if kubectl
bin isn't in $PATH then try microk8s.kubectl
I'm willing to submit pull request if this is found useful
kwall
is really not helpful when trying to monitor a specific namespace, because there's too much information being displayed at once.
The objective here would be to focus on a namespace.
It's an enhancement, is it viable?
Hello,
To manage context and namespace switching functionality - kubectx/kubens toolset could be used.
They could be installed via krew
as other plugins used by fubectl
.
fubectl
could provide useful aliases like kctx
/ kns
, current context / namespace functions would be deprecated.
Tools homepage: https://github.com/ahmetb/kubectx
All prerequsite installed but during the installation I see the following output:
[ -f /Users/1/apps/fubectl/fubectl.source ] && source /Users/1/apps/fubectl/fubectl.source
/Users/1/apps/fubectl/fubectl.source:90: defining function based on alias `ked'
/Users/1/apps/fubectl/fubectl.source:90: parse error near `()'
I'm using fubectl without tree. For what kind of functionality it is needed?
To prevent errors with dependencies like e.g.
Line 202 in 424ad60
kinstall
command what installs the needed dependencieshi,
when using kcs
the code uses the name of the cluster as the context-name:
kcs() {
context="$(kubectl config get-contexts | _inline_fzf | awk '{print $2}')"
eval kubectl config set current-context "${context}"
}
$ kubectl config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
asterix-ns1 asterix user1 ns1
* obelix-ns1 obelix user2 ns1
obelix-ns2 obelix user3 ns2
minikube minikube minikube
this only works, when the clustername and contextname are identical. if they are different, the configuration is corrupted. i think you should use print $1
for awk:
context="$(kubectl config get-contexts | _inline_fzf | awk '{print $1}')"
Discovered the ked
command introduced in fubectl but I currently cannot use it. Two (related) issues I have:
I run ked deploy
and select one of my deployments to edit
Vim: Warning: Input is not from a terminal
appears after selecting a deploy. This seems to be because kubectl edit
runs as part of the xargs from what I see in the code (https://superuser.com/questions/336016/invoking-vi-through-find-xargs-breaks-my-terminal-why)^?
. Probably related to the first issue.zsh version 5.0.2
kex klog func not working
local command in zsh not identify string include space
for example: local val=$(echo "hello world"|awk '{print $1, $2}')
val equal to hello not hello world
i resolve it by double quote like this: "$(echo "hello world"|awk '{print $1, $2}') "
to prevent entering object name every time, we cloud add pod
as default type if the $1
is empty.
Hi there, thanks for the great tool.
I have used it for the past year and recently started using it again on a new computer.
Now, whenever I use klog
or kfor
, it fails with the following error message:
error: expected 'logs [-f] [-p] (POD | TYPE/NAME) [-c CONTAINER]'.
POD or TYPE/NAME is a required argument for the logs command
See 'kubectl logs -h' for help and examples
Any idea why this could be?
Separating the namespace and pod name solves the issue:
kiwiidb@282bc63
kex sh error: expected 'exec POD_NAME COMMAND [ARG1] [ARG2] ... [ARGN]'. POD_NAME and COMMAND are required arguments for the exec command See 'kubectl exec -h' for help and examples.
ksearch <smth>
error: unknown flag: --export
See 'kubectl get --help' for usage.
kubectl version --client
Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.3", GitCommit:"816c97ab8cff8a1c72eccca1026f7820e93e0d25", GitTreeState:"clean", BuildDate:"2022-01-25T21:25:17Z", GoVersion:"go1.17.6", Compiler:"gc", Platform:"linux/amd64"}
kcs
is capable to show what is the current active context, but kcns
does not show the active namespace
For example, kdebug
is described in the project's README, however I can't see any mentions of this function in the current fubectl.source
. (I haven't made a PR for this as I am not sure whether kdebug
should actually exist for fubectl.)
At the same time, quite interesting commands including ked
, ksec
, and konsole
are defined in the source file, however they are missing in the README.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.