ralavay / safe-ops

Make manual ops safer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Safe Ops

CircleCI Codacy Badge

Some simple scripts to wrap command like kubectl, helm, rm, etc with confirmation step for dangerous operations like delete or modify a deployment or a release.

Support

Usage

Clone the repo somewhere like /your/workspace/path/

Then update your ~/.profile or ~/.bashrc with some aliases

# kubectl
alias kubectl="/your/workspace/path/kubectl.sh"

# helm
alias helm="/your/workspace/path/helm.sh"

# rm
alias rm="/your/workspace/path/rm.sh"

Source ~/.profile or ~/.bashrc then when you try to delete/exec/edit something with kubectl or helm you will see this

$ kubectl delete pod/production-pod-1
----------------------------------------------------------
- Current cluster :    k8s.production.seriously.com
----------------------------------------------------------
Are you sure? (Only 'yes' will be accepted to approve)
$ helm delete awesome-app
----------------------------------------------------------
- Current cluster :    k8s.staging.seriously.com
----------------------------------------------------------
Are you sure? (Only 'yes' will be accepted to approve)

About

Make manual ops safer


Languages

Language:Shell 100.0%