Created
January 4, 2018 14:52
-
-
Save zepptron/a78e4e58324c75dbe1170671262f1109 to your computer and use it in GitHub Desktop.
bashrc for faster interaction with kubernetes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## ENVs ## | |
red=`tput setaf 1` | |
green=`tput setaf 2` | |
yellow=`tput setaf 3` | |
reset=`tput sgr0` | |
alias ll="ls -lah" | |
alias k="kubectl" | |
source <(kubectl completion bash) | |
function k-sys() { | |
alias k="kubectl --namespace kube-system" | |
printf "\n${red}kubectl --namespace kube-system active\n\n${reset}" | |
} | |
function k-pub() { | |
alias k="kubectl --namespace kube-public" | |
printf "\n${green}kubectl --namespace kube-public active\n\n${reset}" | |
} | |
function k-def() { | |
alias k="kubectl" | |
printf "\n${green}kubectl without namespace active\n\n${reset}" | |
} | |
function k-nodes() { | |
for i in kube-{1..3}; do | |
printf "${yellow}item: $i:${reset}\n" | |
kubectl describe node $i.foo.io | grep -A4 "Allocated resources:" | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment