Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 1.21 KB

README.md

File metadata and controls

54 lines (40 loc) · 1.21 KB

kubesafe

Verify expected cluster before running Kubernetes commands to prevent accidental changes to the wrong cluster.

Install

MacOS

Homebrew (recommended)

brew tap djmarkoz/djmarkoz
brew install kubesafe

MacOS / Linux

Go get

go get -u github.com/djmarkoz/kubesafe

Usage

kubesafe
Verify expected cluster before running Kubernetes commands

Usage:
  kubesafe [command]

Available Commands:
  explain     Explain which directory expects which cluster
  get         Returns the currently expected cluster
  help        Help about any command
  set         Create a '.kubesafe-expected-cluster' file in the current directory specifying the currently active cluster
  unset       Remove the '.kubesafe-expected-cluster' file in the current directory
  verify      Verify if the current cluster is the expected cluster and optionally run a command

Useful aliases

alias ks='kubesafe'
alias kss='kubesafe set'
alias ksu='kubesafe unset'
alias ksg='kubesafe get'
alias kse='kubesafe explain'
alias ksv='kubesafe verify'

# wrap 'kubectl' and 'helm' commands with 'kubesafe'
alias kubectl='kubesafe verify -- \kubectl'
alias helm='kubesafe verify -- \helm'