0

I have a kubernetes running on EKS AWS. I want to know it if its possible to access the pods logs through the API endpoint AWS offers for the cluster.

I want to send the logs to a serverless loki running in a different service. I'm not allowed to install nor loki neither promtail inside the kubernetes for company reasons, that's why I want to access the logs through the API endpoint.

  • Does this answer your question? [Trigger Kubernetes/EKS cron job via HTTP call](https://stackoverflow.com/questions/70239327/trigger-kubernetes-eks-cron-job-via-http-call) – The Fool Feb 07 '22 at 13:22

1 Answers1

0

Here's a complete guide how to do that using a service account token. To follow the log append ?follow=true like:

curl -s $APISERVER/api/v1/namespaces/<namespace>/pods/<pod name>/log?follow=true --header "Authorization: Bearer $TOKEN"
--cacert ca.crt
gohm'c
  • 13,492
  • 1
  • 9
  • 16