Kubernetes and curl: Difference between revisions
Jump to navigation
Jump to search
(Created page with "=Internal= * Kubernetes Operations") |
No edit summary |
||
Line 2: | Line 2: | ||
* [[Kubernetes Operations#Subjects|Kubernetes Operations]] | * [[Kubernetes Operations#Subjects|Kubernetes Operations]] | ||
=Invoking into the API Server from Inside a Pod= | |||
TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token); curl -sSk -H "Authorization: Bearer ${TOKEN}" https://kubernetes.default/api/v1/namespaces/ | |||
[[Curl#-k_--insecure|-k]] in the command above instructs curl to execute in insecure mode. We can actually run it in secure mode because we have access to the certificate: |
Revision as of 17:00, 13 September 2019
Internal
Invoking into the API Server from Inside a Pod
TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token); curl -sSk -H "Authorization: Bearer ${TOKEN}" https://kubernetes.default/api/v1/namespaces/
-k in the command above instructs curl to execute in insecure mode. We can actually run it in secure mode because we have access to the certificate: