From e4e79eefc56be52813e115bf9f17c896d65e6e22 Mon Sep 17 00:00:00 2001 From: nilement Date: Thu, 24 Mar 2022 00:05:36 +0200 Subject: [PATCH] Add optional labels to nsenter pod (#40) --- kubectl-node_shell | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kubectl-node_shell b/kubectl-node_shell index 539ff65..ac43a54 100755 --- a/kubectl-node_shell +++ b/kubectl-node_shell @@ -97,6 +97,8 @@ $kubectl get node "$node" >/dev/null || exit 1 container_cpu="${KUBECTL_NODE_SHELL_POD_CPU:-100m}" container_memory="${KUBECTL_NODE_SHELL_POD_MEMORY:-256Mi}" +labels="${KUBECTL_NODE_SHELL_LABELS}" + overrides="$( cat <&2 || true; exit \$EC" EXIT INT TERM echo "spawning \"$pod\" on \"$node\"" >&2 -$kubectl run --image "$image" --restart=Never --overrides="$overrides" $([ "$tty" = true ] && echo -t) -i "$pod" $generator +$kubectl run --image "$image" --restart=Never --overrides="$overrides" --labels="$labels" $([ "$tty" = true ] && echo -t) -i "$pod" $generator