config-bash/aliases.d/kubectl

16 lines
561 B
Plaintext
Raw Normal View History

2020-11-18 12:44:46 +01:00
#!/bin/bash
2024-06-18 14:25:09 +02:00
if (command -v kubectl &>/dev/null); then
2020-11-18 12:44:46 +01:00
2024-06-18 14:25:09 +02:00
# create some usefull aliases
alias k="kubectl"
alias kg="kubectl get"
alias kd="kubectl describe"
alias ks="kubectl --namespace kube-system"
alias kga="kubectl get --all-namespaces"
2024-06-24 11:24:32 +02:00
alias kuc="kubectl config unset current-context"
alias kun="kubectl config set-context --current --namespace="
2024-06-24 11:24:32 +02:00
alias kgworkers="kubectl get nodes --selector '!node-role.kubernetes.io/control-plane' --label-columns heat,topology.kubernetes.io/zone,topology.kubernetes.io/region --sort-by metadata.labels.heat"
2020-11-18 12:44:46 +01:00
fi