VladimirLavrenchuk icon

call API

VladimirLavrenchuk | PRO | 03/20/19 06:46:09 AM UTC | 0 ⭐ | 312 👁️ | Never ⏰ | []
Bash |

320 B

|

None

|

0 👍

/

0 👎

APISERVER=$(kubectl config view --minify -o jsonpath='{.clusters[0].cluster.server}')
SECRET_NAME=$(kubectl get serviceaccount default -o jsonpath='{.secrets[0].name}')
TOKEN=$(kubectl get secret $SECRET_NAME -o jsonpath='{.data.token}' | base64 --decode)
curl $APISERVER/api --header "Authorization: Bearer $TOKEN" --insecure

Comments