Skip to content

Instantly share code, notes, and snippets.

@mbaykara
Created August 30, 2023 10:13
Show Gist options
  • Select an option

  • Save mbaykara/46a1acf863ac4b95515a386eb39341a1 to your computer and use it in GitHub Desktop.

Select an option

Save mbaykara/46a1acf863ac4b95515a386eb39341a1 to your computer and use it in GitHub Desktop.
#!/bin/bash
# This is my-aliases.sh
echo 'alias events="kubectl get events --sort-by=.lastTimestamp"' >> ~/.bashrc
echo 'alias kexec="kubectl exec -it curl -- /bin/sh"' >> ~/.bashrc
echo 'alias kurl="kubectl run -it curl --image=curlimages/curl -- /bin/sh"' >> ~/.bashrc
echo 'alias ns="kubens"' >> ~/.bashrc
echo 'alias cc="kubectx"' >> ~/.bashrc
echo 'alias trigger_ci="git commit --allow-empty -m \"trigger CI\" && git push"' >> ~/.bashrc
echo 'alias ksql="kubectl run my-shell --rm -i --tty --image arey/mysql-client --command sh"' >> ~/.bashrc
# Reload the .bashrc to apply changes to the current session
source ~/.bashrc
echo "Aliases have been added to ~/.bashrc and sourced for this session."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment