<p>I need to setup integration tests in a Spring Boot project using Postgres, Redis and Elasticsearch (at some point later also Kafka will be added). So far I've found two options:</p>
<ol>
<li>H2 Database and Embedded Redis. This could work but we are using some Postgres specific functions in some of our queries so this would not allow to cover all the cases.</li>
<li><a href="https://www.testcontainers.org/" rel="nofollow noreferrer">Testcontainers</a>. This looked perfect but apparently it's not possible to run those in pipeline since we are using Kubernetes</li>
</ol>
<p>Third option requires a bit of manual work. It's definitely possible to make a docker compose file with all the services needed for testing for local usage and let infrastructure team build containers the way they want for running tests in a pipeline. But this way a developer would have to manually start/stop those containers when running tests locally.</p>
<p>Is there a way to automate this process? Or any options similar to Testcontainers that would work in Kubernetes? Or perhaps there is a way to run Testcontainers in Kubernetes?</p>
<p>Thank you in advance.</p>

Alex
<p>You can run testcontainers in Kubernetes based builds. You just need a container runtime available in your build (container). This could be rootless docker and is independent of the container runtime used by your kubernetes cluster.</p>
