Skip to content

Commit 9a82846

Browse files
author
Steve Griffith
committed
Updated to force the sshjump pod to a linux node via nodeselector
1 parent 87e12d4 commit 9a82846

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

kubectl-ssh-jump

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,24 @@ run_ssh_node(){
128128
r=$(kubectl get pod sshjump 2>/dev/null | tail -1 | awk '{print $1}') #
129129
if [ "${r}" != "sshjump" ];then
130130
echo "Creating SSH jump host (Pod)..."
131-
kubectl run sshjump --image=corbinu/ssh-server --port=22 --restart=Never
131+
cat <<EOF | kubectl apply -f -
132+
apiVersion: v1
133+
kind: Pod
134+
metadata:
135+
name: sshjump
136+
labels:
137+
env: test
138+
spec:
139+
containers:
140+
- name: sshjump
141+
image: corbinu/ssh-server
142+
ports:
143+
- containerPort: 22
144+
nodeSelector:
145+
"kubernetes.io/os": linux
146+
EOF
147+
148+
#kubectl run sshjump --image=corbinu/ssh-server --port=22 --restart=Never
132149
# Wait until sshjump gets ready
133150
c=1
134151
while [[ ${c} -le ${MAX_POD_CREATION_TIME} ]];

0 commit comments

Comments
 (0)