Add wrappers for env-based kubectl calls
This commit is contained in:
11
bin/kubectl-env
Executable file
11
bin/kubectl-env
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
case "$1" in
|
||||
mycloud)
|
||||
shift
|
||||
command kubectl --kubeconfig=<(pass show mycloud/kubeconfig) "${@}"
|
||||
;;
|
||||
*)
|
||||
command kubectl "${@}"
|
||||
;;
|
||||
esac
|
||||
@@ -208,9 +208,9 @@ tmp() {
|
||||
}
|
||||
|
||||
kubectl_pod() {
|
||||
kubectl get -n "${1}" pods --field-selector=status.phase=Running --selector=${2} -o jsonpath='{.items[*].metadata.name}'
|
||||
kubectl-env mycloud get -n "${1}" pods --field-selector=status.phase=Running --selector=${2} -o jsonpath='{.items[*].metadata.name}'
|
||||
}
|
||||
|
||||
kubectl_deployment() {
|
||||
kubectl get -n "${1}" deployment --selector=${2} -o jsonpath='{.items[*].metadata.name}'
|
||||
kubectl-env mycloud get -n "${1}" deployment --selector=${2} -o jsonpath='{.items[*].metadata.name}'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user