Created
May 13, 2018 16:22
-
-
Save bborysenko/18e4430ce01ba781ccff882451092641 to your computer and use it in GitHub Desktop.
Как дернуть API Kubernetes без kubectl proxy с помощью curl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| secret_name="$(kubectl get serviceaccount helm -o json | jq -Mr '.secrets[].name')" | |
| kubectl get secrets ${secret_name} -o json | jq -Mr '.data["ca.crt"]' | base64 -D > ca.crt | |
| curl --cacert ca.crt -H "Authorization: Bearer $(kubectl get secrets ${secret_name} -o json | jq -Mr '.data.token' | base64 -D)" "https://$(minikube ip):8443" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment