Skip to content

Instantly share code, notes, and snippets.

@jeesmon
Created May 27, 2021 18:15
Show Gist options
  • Save jeesmon/a5b5d4ea48954a01df512136fab9ce59 to your computer and use it in GitHub Desktop.
Save jeesmon/a5b5d4ea48954a01df512136fab9ce59 to your computer and use it in GitHub Desktop.
Kubernetes Pod Exec using curl
curl -k \
--http1.1 \
-H "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
-H "Sec-WebSocket-Version: 13" \
-i \
-N \
-H "Connection: Upgrade" \
-H "Upgrade: websocket" \
-H 'Authorization: Bearer <TOKEN>' \
"<API_SERVER>/api/v1/namespaces/<namespace>/pods/<pod_name>/exec?command=ls&command=-l&stdin=true&stdout=true&stderr=true"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment