run kubectl krew index add kube-lock https://github.com/chaosinthecrd/kube-lock.git to add this repository as a Krew index (this is a temporary step while the plugin is getting accepted to the upstream index)
install the plugin with kubectl krew install kube-lock/lock
create an alias in your .bashrc or .zshrc like: alias kubectl="kubectl-lock kubectl --"
From here, you can use kube-lock by calling kubectl lock followed by the subcommand you wish to use (e.g., kubectl lock lock)
install manually
run go build -o="kubectl-lock" . in the root of the repo, or download from the Github Releases page.
copy the produced binary into somewhere within your path
create an alias in your .bashrc or .zshrc like: alias kubectl="kubectl-lock kubectl --"
From here, you can use kube-lock by calling kubectl-lock followed by the subcommand you wish to use (e.g., kubectl-lock lock)