Gather kubectl logs data to an external service
-
When I run
kubectl logs MyPodNameHere
I get back the standard-out of that pod.My company has a central logging service for all our applications and I would like to send the
logs
output to that service. (Via anHTTPS
endpoint.)But I can't seem to find a way to hook into a Kubernetes API to get that working. Is there a Kubernetes API or other integration point to do this?
NOTE: I am also using Istio. I had hopped that I could use that for this, but I can only see stuff about sending "access logs" in the documnation on Istio. But it seems to me that it should be possible via Istio as well.
Anyone know a way to get this
logs
data sent to an HTTPS endpoint?
-
There are many products that will ship Kubernetes logs off to a central log server. The kubernetes documentation has https://kubernetes.io/docs/concepts/cluster-administration/logging/ that is a good place to start.
There are a number of existing projects that are designed to ship your local off to a central location:
- https://docs.fluentbit.io/manual/installation/kubernetes
- https://www.elastic.co/guide/en/beats/filebeat/current/running-on-kubernetes.html
- https://vector.dev/docs/reference/configuration/sources/kubernetes_logs/
Etc.
And following some of the suggestions in the Kubernetes documentation I linked to earlier you could probably write your own (or reconfigure your existing host-based solutions to support your Kubernetes environment as well).