Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion kubectl-ssh
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ temp_container="ssh-pod-${RANDOM}"

# We want to mount the docker socket on the node of the pod we're exec'ing into.
NODENAME=$( ${KUBECTL} get pod "${POD}" -o go-template='{{.spec.nodeName}}' )
NODESELECTOR='"nodeSelector": {"kubernetes.io/hostname": "'$NODENAME'"},'
HOSTNAME=$( ${KUBECTL} get node ${NODENAME} -o go-template='{{index .metadata.labels "kubernetes.io/hostname"}}' )
NODESELECTOR='"nodeSelector": {"kubernetes.io/hostname": "'$HOSTNAME'"},'

# Adds toleration if the target container runs on a tainted node. Assumes no more than one taint. Change if yours have more than one or are configured differently.
TOLERATION_VALUE=$($KUBECTL get pod "${POD}" -ojsonpath='{.spec.tolerations[].value}') >/dev/null 2>&1
Expand Down