Revert "feat(cleanup): remove all Kubernetes and kubectl references, aliases, and completions"
This reverts commit 5d2a23db88.
This commit is contained in:
@@ -45,6 +45,11 @@
|
|||||||
"key": "Docker",
|
"key": "Docker",
|
||||||
"text": "docker --version 2>/dev/null | cut -d' ' -f3 | tr -d ','"
|
"text": "docker --version 2>/dev/null | cut -d' ' -f3 | tr -d ','"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"key": "Kubectl",
|
||||||
|
"text": "kubectl version --client --output=yaml 2>/dev/null | grep gitVersion | cut -d' ' -f4"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "command",
|
"type": "command",
|
||||||
"key": "Go",
|
"key": "Go",
|
||||||
|
|||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
/Applications/OrbStack.app/Contents/MacOS/../Resources/completions/fish/kubectl.fish
|
||||||
@@ -3,10 +3,13 @@ alias ld="ls -lisaGh"
|
|||||||
alias g="goto"
|
alias g="goto"
|
||||||
alias vim="nvim"
|
alias vim="nvim"
|
||||||
alias code="open -a 'Visual Studio Code'"
|
alias code="open -a 'Visual Studio Code'"
|
||||||
|
alias kubi="open -a 'Lens'"
|
||||||
alias do-st="docker compose"
|
alias do-st="docker compose"
|
||||||
alias do-re="docker compose down && docker compose up -d"
|
alias do-re="docker compose down && docker compose up -d"
|
||||||
|
|
||||||
alias qaserv="TERM=xterm-256color ssh root@195.201.17.47"
|
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"
|
alias ram="vm_stat"
|
||||||
|
|
||||||
# DevOps Core Tools
|
# DevOps Core Tools
|
||||||
@@ -18,6 +21,18 @@ alias dcl="docker compose logs -f"
|
|||||||
alias dce="docker compose exec"
|
alias dce="docker compose exec"
|
||||||
alias dps="docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'"
|
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
|
# Testing
|
||||||
alias pw="pnpm exec playwright"
|
alias pw="pnpm exec playwright"
|
||||||
alias pwt="pnpm exec playwright test"
|
alias pwt="pnpm exec playwright test"
|
||||||
|
|||||||
@@ -13,6 +13,13 @@ function docker-cleanup
|
|||||||
docker volume prune -f
|
docker volume prune -f
|
||||||
end
|
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
|
# Quick YAML validation
|
||||||
function yaml-check
|
function yaml-check
|
||||||
python3 -c "import yaml; yaml.safe_load(open('$argv[1]'))"
|
python3 -c "import yaml; yaml.safe_load(open('$argv[1]'))"
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
# 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,3 +27,8 @@ function vdocker
|
|||||||
echo "No Docker files found"
|
echo "No Docker files found"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Edit kubernetes manifests
|
||||||
|
function vk8s
|
||||||
|
find . -name "*.yaml" -o -name "*.yml" | grep -E "(k8s|kubernetes|deploy)" | head -5 | xargs nvim
|
||||||
|
end
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ $time\
|
|||||||
$directory\
|
$directory\
|
||||||
$git_branch\
|
$git_branch\
|
||||||
$git_status\
|
$git_status\
|
||||||
|
$kubernetes\
|
||||||
$docker_context\
|
$docker_context\
|
||||||
$python\
|
$python\
|
||||||
$golang\
|
$golang\
|
||||||
@@ -50,6 +51,12 @@ staged = "+"
|
|||||||
renamed = "»"
|
renamed = "»"
|
||||||
deleted = "✘"
|
deleted = "✘"
|
||||||
|
|
||||||
|
[kubernetes]
|
||||||
|
format = '[$symbol$context( \($namespace\))]($style) '
|
||||||
|
symbol = "☸ "
|
||||||
|
style = "bold cyan"
|
||||||
|
disabled = false
|
||||||
|
|
||||||
[docker_context]
|
[docker_context]
|
||||||
symbol = " "
|
symbol = " "
|
||||||
format = "[$symbol$context]($style) "
|
format = "[$symbol$context]($style) "
|
||||||
|
|||||||
@@ -264,6 +264,7 @@ Das Installationsskript kann optional verschiedene KI-Kommandozeilentools für S
|
|||||||
- **Mise Integration** - Modernes Tool- & Node-Version-Management
|
- **Mise Integration** - Modernes Tool- & Node-Version-Management
|
||||||
- **FZF Integration** - Fuzzy finding everywhere
|
- **FZF Integration** - Fuzzy finding everywhere
|
||||||
- **Git Shortcuts** - Aliases für häufige Commands
|
- **Git Shortcuts** - Aliases für häufige Commands
|
||||||
|
- **Kubernetes** - kubectl completion
|
||||||
- **Auto-completion** - Für Docker, Git, etc.
|
- **Auto-completion** - Für Docker, Git, etc.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
Reference in New Issue
Block a user