X
X
XTGH2021-10-06 23:04:35
linux
XTGH, 2021-10-06 23:04:35

How to make readinessProbe by file text?

The program writes logs to a file, how can I check for readiness by the presence of an entry in the file?
For example, I'm trying to use grep, but pod won't start. Deployment piece:

readinessProbe:
          exec:
           command:
           - cat
           - /app/log | grep -q "app start"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2021-10-06
@XTGH

you don't need a cat and an unnecessary pipe - just.
grep -q "app start" /app/log
But are you sure it's okay to look at the whole log file every iteration of the redness probe?
Maybe it's better to add an additional endpoint to the program and check it through an http probe?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question