Reputation: 61
I am trying to query a specific container's logs within a pod of several containers:
curl --cacert ${CACERT} --header "Authorization: Bearer ${TOKEN}" -X GET ${APISERVER}/api/v1/namespaces/demo/pods/mypod-fgsardg4-dfsdf/log
How do I specify a particular container within this pod? I see that is part of the query via: https://kubernetes.io/docs/reference/kubernetes-api/workloads-resources/pod-v1/
But am not sure what it means by "in query".
This type of request fails:
curl --cacert ${CACERT} --header "Authorization: Bearer ${TOKEN}" -X GET ${APISERVER}/api/v1/namespaces/demo/pods/mypod-fgsardg4-dfsdf/containername/log
Upvotes: 0
Views: 75
Reputation: 61
Figured it out:
GET /api/v1/namespaces/{namespace}/pods/{name}/log?container=test
Just didn't quite have the API syntax all the way there.
Upvotes: 2