0

I used conda and flask in k8s, but ‘kubectl logs pod’does not have any logs.

  1. activate conda env:SHELL ["conda","run","-n","env_name","bin/bash","-c"]
  2. run flask(seldon) application: CMD exec seldon-core-microservice Model --service-type MODEL --persistence 0
  3. "docker run -ti " local container can display logs
  4. "kubectl logs " dones not have any logs

I set log config in .py:

logging.basicConfig(level=logging.INFO)

logger = logging.get Logger(__name__)

And try to print some logs by:

logging.info("hello world")

Debug in the local container can see logs, but pod does not have logs. Other pods created in the same way, as long as Conda is not used, can see logs Any advices? Thanks.

xRandom
  • 69
  • 2
  • 10
  • show kubect get events. – Richard Rublev Jul 27 '23 at 06:00
  • How are you running it in Kubernetes? (Does your Pod spec override `command:` or `args:`?) Does your Dockerfile [set PYTHONUNBUFFERED](https://stackoverflow.com/questions/29663459/python-app-does-not-print-anything-when-running-detached-in-docker)? – David Maze Jul 27 '23 at 10:42
  • In DOCKERFILE, I have set PYTHONUNBUFFERED=1 but It doesn't work. – xRandom Aug 02 '23 at 09:35

0 Answers0