In this post, we will see how to resolve Using flask socketio to follow kubernetes pod
Question:
I am trying to send kubernetes pod logs usingsocketio
websocket to client, I can see the print(line_str)
but socket cannot connect and cannot recieve anything under log_line
eventws://localhost:5005/ws-connect?namespace=<ns>&pod=<pod_name>
Thread is not blocked I can still use flask for other endpoints, I just cannot connect through websocket. Any help is appreciated
Best Answer:
Instead of doing every step inconnect
event, just parsed between events. Solution below works for me.If you have better answer, please add a comment about this, thank you!
Source: Stackoverflow.com