<p><a href="https://kubernetes.io/blog/2020/12/02/dont-panic-kubernetes-and-docker/" rel="nofollow noreferrer">Since Kubernetes 1.20</a>, Docker support is deprecated and will be totally removed from 1.24. We use GKE to manage Kubernetes so the upgrade will be done automatically.</p>
<p>As far as I've read, developers should not have been impacted but we made tests in Kubernetes 1.23 to check that all is OK and it seems we have some issues with a microservice using Testcontainers :</p>
<pre><code>09:59:44.578 [testcontainers-ryuk] WARN org.testcontainers.utility.ResourceReaper - Can not connect to Ryuk at localhost:49153
java.net.ConnectException: Connection refused (Connection refused)
    at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
    at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
    at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)
    at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403)
    at java.base/java.net.Socket.connect(Socket.java:591)
    at org.testcontainers.utility.ResourceReaper.lambda$null$3(ResourceReaper.java:194)
    at org.rnorth.ducttape.ratelimits.RateLimiter.doWhenReady(RateLimiter.java:27)
    at org.testcontainers.utility.ResourceReaper.lambda$start$4(ResourceReaper.java:190)
    at java.base/java.lang.Thread.run(Thread.java:835)
</code></pre>
<p>This is not reproductible on a Kubernetes 1.19 where Docker is not deprecated nor removed.</p>
<p>We tried to disable Ryuk in <code>pom.xml</code> (as indicated for this error in a <a href="https://github.com/testcontainers/testcontainers-java/issues/3609" rel="nofollow noreferrer">Testcontainers issue</a>) but it has no effect :</p>
<pre><code>&lt;plugin&gt;
    &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
    &lt;artifactId&gt;maven-failsafe-plugin&lt;/artifactId&gt;
    &lt;executions&gt;
        &lt;execution&gt;
            &lt;goals&gt;
                &lt;goal&gt;verify&lt;/goal&gt;
                &lt;goal&gt;integration-test&lt;/goal&gt;
            &lt;/goals&gt;
            &lt;configuration&gt;
                &lt;environmentVariables&gt;
                    &lt;TESTCONTAINERS_RYUK_DISABLED&gt;true&lt;/TESTCONTAINERS_RYUK_DISABLED&gt;
                &lt;/environmentVariables&gt;
            &lt;/configuration&gt;
        &lt;/execution&gt;
    &lt;/executions&gt;
&lt;/plugin&gt;
</code></pre>
<p>To reproduce locally, we tried to launch IT with testcontainers in a Minikube with Kubernetes 1.23 and Containerd as container runtime (no docker env):</p>
<pre><code>minikube start --kubernetes-version v1.23.0 
--network-plugin=cni 
--enable-default-cni 
--container-runtime=containerd 
--bootstrapper=kubeadm
</code></pre>
<p>But it leads to this error when launching <code>mvn -T 2 failsafe:integration-test failsafe:verify</code> :</p>
<pre><code>[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.87 s &lt;&lt;&lt; FAILURE! - in com.ggl.merch.kafka.it.MerchandisingConsumerIT                   
[ERROR] should_consume_merchandising_message_and_process_record  Time elapsed: 0.012 s  &lt;&lt;&lt; ERROR!                                                                                                                 
java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration                   
        at com.ggl.merch.kafka.it.MerchandisingConsumerIT.&lt;init&gt;(MerchandisingConsumerIT.java:91)   
</code></pre>
<p>Anyone already had the same problem?</p>
<p>Thank you by advance!</p>

François Delbrayelle
<p><strong>Solved</strong> by putting this in our configuration:</p>
<pre><code>- name: &quot;TESTCONTAINERS_HOST_OVERRIDE&quot;
  valueFrom:
    fieldRef:
      fieldPath: status.hostIP
</code></pre>
<p>Following <a href="https://www.testcontainers.org/features/configuration/" rel="nofollow noreferrer">this doc</a>:</p>
<blockquote>
<p><strong><code>TESTCONTAINERS_HOST_OVERRIDE</code></strong><br />
    Docker's host on which ports are exposed.<br />
    Example: <code>docker.svc.local</code></p>
</blockquote>
