Skip to content

Instantly share code, notes, and snippets.

@MaximShepelev
Last active January 27, 2022 13:32
Show Gist options
  • Save MaximShepelev/5e4efe2924263bf9a1a11f946f7e6567 to your computer and use it in GitHub Desktop.
Save MaximShepelev/5e4efe2924263bf9a1a11f946f7e6567 to your computer and use it in GitHub Desktop.
# ----- kubectl ----------
alias k='kubectl'
alias kdl='kubectl delete'
alias klg='kubectl logs'
alias klf='kubectl logs -f'
alias kaf='kubectl apply -f'
alias kdlf='kubectl delete -f'
# ----- kubectl get ----------
alias kg='kubectl get'
alias kgp='kubectl get pods -o wide'
alias kgd='kubectl get deploy -o wide'
alias kgs='kubectl get svc -o wide'
alias kgn='kubectl get nodes -o wide'
# ----- kubectl describe ----------
alias kd='kubectl describe'
alias kdp='kubectl describe pods'
alias kdd='kubectl describe deploy'
alias kds='kubectl describe svc'
alias kdn='kubectl describe nodes'
# ----- Kubectl config ------
alias kc='kubectl config'
alias kcgc='kubectl config get-contexts'
alias kcuc='kubectl config use-context'
# alias kcdfns='kubectl config set-context --current --namespace=$1'
function kcdfns() {
kcgc | grep '\*'
kubectl config set-context --current --namespace=$1
kcgc | grep '\*'
}
# wget https://raw.githubusercontent.com/jonmosco/kube-ps1/master/kube-ps1.sh -P ~/.local/
activate-kube-prompt(){
source ~/.local/kube-ps1.sh
PS1='[\u@\h \W $(kube_ps1)]\$ '
}
deactivate-kube-prompt(){
source ~/.bashrc
}
## Git aliases
alias gA='git add -A'
alias ga='git add .'
alias gcm='git commit -m'
alias gp='git push'
alias gpu='git push -u'
alias gpom='git push -u origin master'
alias gpo='git push -u origin'
## Ansible
alias ap='ansible-playbook'
alias agi='ansible-galaxy install'
@MaximShepelev
Copy link
Author

Install with

wget https://gist.githubusercontent.com/Madmaxguy/5e4efe2924263bf9a1a11f946f7e6567/raw/f6db1f5207fdc0c1d2f372df980047060846b5ea/bash-aliases-common -O ${HOME}/.bashrc_alises_common
echo 'source ~/.bashrc_alises_common' >> $HOME/.bashrc
source $HOME/.bashrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment