1

Not sure how to name it, but having a rails app, and using sidekiq; I'd like to be able to view both sidekiq and rails logs when running kubectl logs {podname}

Is that even possible ? is there another possibility (like extra commands to logs specific sources) ? Just wondering where to start investigating

Ben
  • 5,030
  • 6
  • 53
  • 94
  • 1
    Possible duplicate of [How do I get logs from all pods of a Kubernetes replication controller?](https://stackoverflow.com/questions/33069736/how-do-i-get-logs-from-all-pods-of-a-kubernetes-replication-controller) – Gabriel Miretti aka gmiretti Nov 06 '17 at 12:45
  • Not really, I'm asking about what can internally be done in a controller to concat logs (think foreman, without foreman) – Ben Nov 06 '17 at 12:49

1 Answers1

1

You should run your rails app in one container and sidekiq in another container. Both of them can run in the same pod. Assuming they're are indeed in the same pod but different containers then you can get each of their logs with the appropriate:

kubectl logs my-pod -c my-container

If otherwise you run them each in their own pods, getting each of their logs should be the default setup of just calling kubectl logs my-pod for each of them.

If you want to aggregate logs from multiple sources you should use something like kubetail.

vascop
  • 4,972
  • 4
  • 37
  • 50