shenxn/protonmail-bridge-docker

livenessProbe and/or healthcheck

davellx opened this issue · 2 comments

Hello,

I installed protonmail-bridge on a k8s cluster and it seems to work... but after a little while (few days, don't know how exactly) I start to see errors like that :
ERRO[Jul 13 20:39:01.477] 401: Le jeton d’accès n’est pas valide. (Code=401, Status=401), Attempt 1

All I have to do is restart the pod (I prefer to scale to 0 and rescale to 1 but I think it would also work with a rollout restart or by deleting pod) but the thing is that I don't know it failed the first place. And then after a few days it fails again.

I wondered if someone have found a solution to implement a liveness probe or a healthcheck for this docker image ?
The bridge cli seems to be unusable because the main process locks it.

Thanks in advance.

krair commented

Perhaps this isn't the cleanest solution, but for now I have the healthcheck command as:

echo "quit" | openssl s_client -starttls smtp -quiet -prexit -connect 127.0.0.1:25 2>&1 | grep "250 SIZE"

This effectively connects to the bridge via smtp, sends the "EHLO" command and looks for the "250" response. It sends "quit" to immediately close the connection as well.

That seems a very nice solution usable with the liveness probe of kubernetes.

Thanks a lot, I'll try it !