Skip to content

Commit

Permalink
Add optional labels to nsenter pod (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
nilement committed Mar 23, 2022
1 parent e52ee65 commit e4e79ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kubectl-node_shell
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOT
{
Expand Down Expand Up @@ -151,4 +153,4 @@ fi
trap "EC=\$?; $kubectl delete pod --wait=false $pod >&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

0 comments on commit e4e79ee

Please sign in to comment.