Skip to content

Commit

Permalink
Add 'kubecolor'
Browse files Browse the repository at this point in the history
  • Loading branch information
fhemberger committed Feb 2, 2024
1 parent 25c8f1c commit 7f923c6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
33 changes: 19 additions & 14 deletions dot_config/zsh/kubectl.zsh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env zsh
#shellcheck disable=SC2139

if [ "${commands[kubectl]}" ]; then
kubectl() {
Expand All @@ -7,19 +8,24 @@ if [ "${commands[kubectl]}" ]; then
$0 "$@"
}

alias k='kubectl'
alias ka='kubectl apply'
alias kc='kubectl create'
alias kdel='kubectl delete'
alias kd='kubectl describe'
alias ked='kubectl edit'
alias kex='kubectl exec'
alias kg='kubectl get'
alias kga='kubectl get all,csr,cm,ds,hpa,ing,jobs,netpol,pvc,pdb,podtemplates,rc,quota,secrets,sa,statefulsets'
alias kl='kubectl logs'
alias kpf='kubectl port-forward'
alias kpx='kubectl proxy'
alias kw='watch kubectl get'
executable='kubectl'
if [ "${commands[kubecolor]}" ]; then
executable='kubectl'
fi

alias k="$executable"
alias ka="$executable apply"
alias kc="$executable create"
alias kdel="$executable delete"
alias kd="$executable describe"
alias ked="$executable edit"
alias kex="$executable exec"
alias kg="$executable get"
alias kga="$executable get all,csr,cm,ds,hpa,ing,jobs,netpol,pvc,pdb,podtemplates,rc,quota,secrets,sa,statefulsets"
alias kl="$executable logs"
alias kpf="$executable port-forward"
alias kpx="$executable proxy"
alias kw="watch $executable get"
alias kx='kubectx'
alias kn='kubens'

Expand All @@ -33,4 +39,3 @@ if [ "${commands[kubectl]}" ]; then

export KUBECONFIG="${HOME}/.kube/config:$(find "${HOME}/.kube/config.d" -type f -print0 | tr '\0' ':' | head -c -1)"
fi

2 changes: 2 additions & 0 deletions packages/Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ tap "homebrew/bundle"
tap "homebrew/cask-fonts"
tap "homebrew/cask-versions"
tap "homebrew/services"
tap "kubecolor/tap"
tap "minio/stable"
tap "yt-dlp/taps"
brew "act"
Expand Down Expand Up @@ -96,6 +97,7 @@ brew "creativeprojects/tap/resticprofile"
brew "goreleaser/tap/goreleaser"
brew "goreleaser/tap/nfpm"
brew "hashicorp/tap/terraform"
brew "kubecolor/tap/kubecolor"
brew "minio/stable/mc"
cask "alfred"
cask "android-platform-tools"
Expand Down

0 comments on commit 7f923c6

Please sign in to comment.