Skip to content

Instantly share code, notes, and snippets.

@bborysenko
Created May 13, 2018 16:22
Show Gist options
  • Select an option

  • Save bborysenko/18e4430ce01ba781ccff882451092641 to your computer and use it in GitHub Desktop.

Select an option

Save bborysenko/18e4430ce01ba781ccff882451092641 to your computer and use it in GitHub Desktop.
Как дернуть API Kubernetes без kubectl proxy с помощью curl
#!/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