<p>I'm trying of running my cicd tests (as a personal challenge), for android, on Kubernetes.
I ran the docker-android container (<a href="https://github.com/budtmo/docker-android" rel="nofollow noreferrer">https://github.com/budtmo/docker-android</a>), and followed the guide on my computer, and it worked (I managed to run one container on my linux pc, and control the device via the website, and the command line). The problem is that I ran only one device, and I want to run multiple containers (for multiple tests simultaneity). </p>

<p>How can I run multiple containers of this image on kubernetes (or is it possible)? Do I need to allocate new different ports for every simulator? </p>

<p>P.S On the github link, they tagged "kubernetes", so I guess it means its possible.</p>

Yagel
<p>You can run as many containers as you want.</p>

<p>Briefly it could be done in two steps:</p>

<ol>
<li><p>Create <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" rel="nofollow noreferrer">a Deployment</a> specifying all containers with their configurations. In your case they all will use the same image but will have different devices, Android versions, etc.</p></li>
<li><p>Configure <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">Services</a> for your applications so that the applications will be exposed.</p></li>
</ol>

<p>Note, you can use exactly the same ports for your applications, they won't interfere. The services will take care of mapping needed ports inside containers.</p>

<p><strong>Use case:</strong></p>

<p>Usually such configuration is used with CI servers.
For instance, you commit a change to a branch called <code>fix-123</code>.
The CI server creates a deployment with, say, 2 containers: Galaxy S6 and  Pixel 2.
The services expose the containers as:</p>

<pre><code>fix-123-galaxy-s6.your-kubernetes-cluster.com
fix-123-pixel-2.your-kubernetes-cluster.com
</code></pre>

<p>Later you might crete a new branch called <code>feature-456</code> and your CI system will expose your containers to:</p>

<pre><code>feature-456-galaxy-s6.your-kubernetes-cluster.com
feature-456-pixel-2.your-kubernetes-cluster.com 
</code></pre>

<p>All four will live together without interference.</p>
