feat(cleanup): remove all Kubernetes and kubectl references, aliases, and completions
This commit is contained in:
@@ -3,13 +3,10 @@ alias ld="ls -lisaGh"
|
||||
alias g="goto"
|
||||
alias vim="nvim"
|
||||
alias code="open -a 'Visual Studio Code'"
|
||||
alias kubi="open -a 'Lens'"
|
||||
alias do-st="docker compose"
|
||||
alias do-re="docker compose down && docker compose up -d"
|
||||
|
||||
alias qaserv="TERM=xterm-256color ssh root@195.201.17.47"
|
||||
alias kc1="set -gx KUBECONFIG ~/.kube/config"
|
||||
alias kc2="set -gx KUBECONFIG ~/.kube/work"
|
||||
alias ram="vm_stat"
|
||||
|
||||
# DevOps Core Tools
|
||||
@@ -21,18 +18,6 @@ alias dcl="docker compose logs -f"
|
||||
alias dce="docker compose exec"
|
||||
alias dps="docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'"
|
||||
|
||||
# Kubernetes power aliases
|
||||
alias k="kubectl"
|
||||
alias kx="kubectx" # Context switching
|
||||
alias kn="kubens" # Namespace switching
|
||||
alias kgp="kubectl get pods -o wide"
|
||||
alias kgs="kubectl get svc -o wide"
|
||||
alias kgd="kubectl get deploy -o wide"
|
||||
alias kl="kubectl logs -f"
|
||||
alias ke="kubectl exec -it"
|
||||
alias kdesc="kubectl describe"
|
||||
alias kpf="kubectl port-forward"
|
||||
|
||||
# Testing
|
||||
alias pw="pnpm exec playwright"
|
||||
alias pwt="pnpm exec playwright test"
|
||||
|
||||
@@ -13,13 +13,6 @@ function docker-cleanup
|
||||
docker volume prune -f
|
||||
end
|
||||
|
||||
# Kubernetes context info
|
||||
function kinfo
|
||||
echo "Context: "(kubectl config current-context)
|
||||
echo "Namespace: "(kubectl config view --minify -o jsonpath='{..namespace}')
|
||||
kubectl get nodes --no-headers | wc -l | xargs echo "Nodes:"
|
||||
end
|
||||
|
||||
# Quick YAML validation
|
||||
function yaml-check
|
||||
python3 -c "import yaml; yaml.safe_load(open('$argv[1]'))"
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
# Kubernetes setup
|
||||
set -gx KUBECONFIG ~/.kube/config
|
||||
|
||||
# Kubernetes aliases
|
||||
alias k="kubectl"
|
||||
alias kgp="kubectl get pods"
|
||||
alias kgn="kubectl get nodes"
|
||||
alias kgs="kubectl get services"
|
||||
alias kgc="kubectl config get-contexts"
|
||||
alias kuc="kubectl config use-context"
|
||||
alias kns="kubectl config set-context --current --namespace"
|
||||
|
||||
# Kubernetes context function
|
||||
function update_kubernetes_context
|
||||
if command -q kubectl
|
||||
set -l kube_ctx (kubectl config current-context 2>/dev/null)
|
||||
if test $status -eq 0
|
||||
set -l kube_ns (kubectl config view --minify --output 'jsonpath={..namespace}' 2>/dev/null)
|
||||
set -gx STARSHIP_KUBERNETES_CONTEXT $kube_ctx
|
||||
if test -n "$kube_ns"
|
||||
set -gx STARSHIP_KUBERNETES_NAMESPACE $kube_ns
|
||||
end
|
||||
else
|
||||
set -e STARSHIP_KUBERNETES_CONTEXT
|
||||
set -e STARSHIP_KUBERNETES_NAMESPACE
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Wrapper for kubectl
|
||||
function kubectl
|
||||
command kubectl $argv
|
||||
set -l exit_code $status
|
||||
|
||||
if test $exit_code -eq 0; and test "$argv[1]" = "config"; and contains "$argv[2]" "use-context" "set-context"
|
||||
update_kubernetes_context
|
||||
end
|
||||
return $exit_code
|
||||
end
|
||||
|
||||
# Update context on startup
|
||||
update_kubernetes_context
|
||||
@@ -27,8 +27,3 @@ function vdocker
|
||||
echo "No Docker files found"
|
||||
end
|
||||
end
|
||||
|
||||
# Edit kubernetes manifests
|
||||
function vk8s
|
||||
find . -name "*.yaml" -o -name "*.yml" | grep -E "(k8s|kubernetes|deploy)" | head -5 | xargs nvim
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user