Skip to content

Instantly share code, notes, and snippets.

@csrwng
Created March 26, 2019 19:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save csrwng/f97044ff7e5e526943ebe12c0c0f86b0 to your computer and use it in GitHub Desktop.
Save csrwng/f97044ff7e5e526943ebe12c0c0f86b0 to your computer and use it in GitHub Desktop.
#!/bin/bash
decode="-d"
if [ "$(uname)" == "Darwin" ]; then
decode="-D"
fi
curl --cacert <(kubectl config view --flatten -o jsonpath='{ .clusters[0].cluster.certificate-authority-data }' | base64 ${decode}) \
--cert <(kubectl config view --flatten -o jsonpath='{ .users[0].user.client-certificate-data }' | base64 ${decode}) \
--key <(kubectl config view --flatten -o jsonpath='{ .users[0].user.client-key-data }' | base64 ${decode}) "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment