Advertisement
VladimirLavrenchuk

call API

Mar 20th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.32 KB | None | 0 0
  1. APISERVER=$(kubectl config view --minify -o jsonpath='{.clusters[0].cluster.server}')
  2. SECRET_NAME=$(kubectl get serviceaccount default -o jsonpath='{.secrets[0].name}')
  3. TOKEN=$(kubectl get secret $SECRET_NAME -o jsonpath='{.data.token}' | base64 --decode)
  4. curl $APISERVER/api --header "Authorization: Bearer $TOKEN" --insecure
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement