Skip to content
djmarkozPublic

About

Verify expected cluster before running Kubernetes commands

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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'

About

Verify expected cluster before running Kubernetes commands

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages