Lots of changes

This commit is contained in:
2021-10-14 10:11:17 +01:00
parent 7a0806ce75
commit edfbcee609
9 changed files with 40 additions and 21 deletions

View File

@@ -1,4 +1,5 @@
alias k='kubectl '
alias kgs='kubectl-gs '
alias kshell='kubectl run -it shell --image bash --restart Never --rm -- sh'
kiam () {
@@ -70,12 +71,6 @@ kube-forward() {
source <(kubectl completion zsh)
## Merge multiple kubeconfigs
function join_by { local d=$1; shift; echo -n "$1"; shift; printf "%s" "${@/#/$d}"; }
KUBECONFIG="$HOME/.kube/config"
OTHER_CLUSTERS="$(join_by :$HOME/.kube/clusters/ $(echo $HOME/.kube/clusters/$(/bin/ls $HOME/.kube/clusters)))"
export KUBECONFIG=$KUBECONFIG:$OTHER_CLUSTERS
## Kubectl exec
kx () {
local pod=($(kubectl get pods --all-namespaces -owide | fzf | awk '{print $1, $2}'))
@@ -99,13 +94,6 @@ kall () {
kubectl get all --all-namespaces
}
kctx () {
KUBECONFIG="$HOME/.kube/config"
OTHER_CLUSTERS="$(join_by :$HOME/.kube/clusters/ $(echo $HOME/.kube/clusters/$(ls $HOME/.kube/clusters)))"
export KUBECONFIG=$KUBECONFIG:$OTHER_CLUSTERS
kubectx $@
}
k-version-test() {
VERSION=""
FILES=""