Skip to content
Safe operations in kubectl with plugin kubectlsafe
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
kubectl-safe

README.md

kubectlsafe

Plugin for kubectl for safe write operations in Kubernetes

Before every write (apply, create, etc...) operation kubectl will ask you about you choise

Installation

It's simple as 1, 2, 3:

Download kubectl-safe to /usr/local/bin, add eXecutable bit and add to your aliases

sudo wget https://raw.githubusercontent.com/esin/kubectlsafe/master/kubectl-safe -O /usr/local/bin/kubectl-safe
sudo chmod +x /usr/local/bin/kubectl-safe
echo "alias kubectl='kubectl safe'" >> $HOME/.bashrc
. $HOME/.basrc

If you don't have root access, you can do like that:

mkdir $HOME/bin
wget https://raw.githubusercontent.com/esin/kubectlsafe/master/kubectl-safe -O $HOME/bin/kubectl-safe
chmod +x $HOME/bin/kubectl-safe
echo "alias kubectl='kubectl safe'" >> $HOME/.bashrc
. $HOME/.basrc

That's all

Example

andrey@andreypc:~$ kubectl delete pod nginx-549cfdbc34-jdos4
Current context is kube-prod. Show must go on? y #Only after that operation will begin
pod "nginx-549cfdbc34-jdos4" deleted

Contributions

Feel free to ask questions and apply new ideas

Happy kubectling! :)

You can’t perform that action at this time.