Skip to content

Instantly share code, notes, and snippets.

@stibi
Last active June 11, 2016 15:16
Show Gist options
  • Save stibi/20a2a8f084823a8edeacf39a5e02867f to your computer and use it in GitHub Desktop.
Save stibi/20a2a8f084823a8edeacf39a5e02867f to your computer and use it in GitHub Desktop.
#!/bin/bash
set -euo pipefail
KUBE_TOKEN="authtoken"
POD_NAME="yourpod"
EXEC_URL="https://your_k8s_cluster/api/v1/namespaces/default/pods/${POD_NAME}/exec"
curl -sSk -N -H "Connection: Upgrade" -H "Upgrade: websocket" \
-H "Sec-WebSocket-Key: MKuU3hrynEXL1F00D3ZyOQ==" \
-H "Sec-WebSocket-Version: 13" \
-H "Authorization: Bearer $KUBE_TOKEN" \
${EXEC_URL}?container=your-container\&command=pwd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment