Skip to content

Paul-Lyu/PodUseCurl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

PodUseCurl

Create a Pod let curl command be used in a Pod to retrieve all Pods in the default namespace Use the following command to create the Pod in Kubernetes cluster:

kubectl apply -f curl-pod.yaml

After the Pod is created, use the following command to execute pod:

kubectl exec -it curl-pod -- /bin/sh

Use the curl command to retrieve all pod in default namespace:

curl -k -H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" \
     https://kubernetes.default.svc.cluster.local/api/v1/namespaces/default/pods

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published