22 lines
1000 B
Plaintext
Raw Normal View History

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