From a4169f1007006acf9540f402274b9308ad4f660c Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Wed, 29 Sep 2021 14:55:16 -0700 Subject: [PATCH] Add kube-shell script, for running shell commands in a deployed container Co-Authored-By: Nathan Sobo --- script/kube-shell | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 script/kube-shell diff --git a/script/kube-shell b/script/kube-shell new file mode 100755 index 0000000000..9181dc959c --- /dev/null +++ b/script/kube-shell @@ -0,0 +1,11 @@ +#!/bin/bash + +if [[ $# < 1 ]]; then + echo "Usage: $0 [production|staging|...]" + exit 1 +fi + +export ZED_KUBE_NAMESPACE=$1 + +pod=$(kubectl --namespace=${ZED_KUBE_NAMESPACE} get pods --selector=app=zed --output=jsonpath='{.items[*].metadata.name}') +exec kubectl --namespace $ZED_KUBE_NAMESPACE exec --tty --stdin $pod -- /bin/bash \ No newline at end of file