0

I have a situation where my acceptance test makes a connection with a rabbitMQ instance during the pipeline. But the rabbitMQ instance is private, making not possible to make this connection in the pipeline.

I was wondering if making an api endpoint that run this test and adding to the startup probe would be a good approach to make sure this test is passing.

1 Answers1

0

If the rabbitmq is a container in your pod yes, if it isn't then you shouldn't.

There's no final answer to this, but the startup probe is just there to ensure that your pod is not being falsly considered unhealthy by other probes just because it takes a little longer to start. It's aimed at legacy applications that need to build assets or compile stuff at startup.

If there was a place to put a connectivity test to rabitmq would be the liveness probe, but you should only do that if your application is entirely dependent on a connection to rabbitmq, otherwise your authentication would fail because you couldn't connect to the messaging queue. And if you have a second app that tries to connect to your endpoint as a liveness probe? And a third app that connects the second one to check if that app is alive? You could kill an entire ecosystem just because rabbitmq rebooted or crashed real quick.

Not recommended.

You could have that as part of your liveness probe IF your app is a worker, then, not having a connection to rabbitmq would make the worker unusable.

Your acceptance tests should be placed on your CD or in a post-deploy script step if you don't have a CD.

Magus
  • 2,905
  • 28
  • 36
  • 1
    Thanks! I do have a CD, but in this CD I can't access the rabbitMQ because it's a private one. And that's something I can't change. I will give a try to yours the post-deploy script suggestion. Thanks again – Marcos Penha Nov 15 '21 at 23:52