-1

I want to display live logs of a Kubernetes pod on a web page in flask. I have a process running and want to display its current state on a webpage for a user. For that I want the live logs to be displayed on the UI.

Jonas
  • 121,568
  • 97
  • 310
  • 388

1 Answers1

0

The core API for this is part of the Pods API: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#read-log-pod-v1-core

You would want to provide the follow option. This does appear to be supported by the Python client library, however it's a blocking operation so you would need to find some async-y way to return that stream to your web client (websockets perhaps) and write some javascript to display it.

This is not going to be a simple thing, as is often the case with nested async APIs.

coderanger
  • 52,400
  • 4
  • 52
  • 75