<p>I've been trying to convert my SimpleLogin Docker containers to Kubernetes using Rancher. However one of the steps requires me to create a network.</p>
<pre><code>sudo docker network create -d bridge \
--subnet=240.0.0.0/24 \
--gateway=240.0.0.1 \
sl-network
</code></pre>
<p>I couldn't really find a way to do this on Kubernetes/Rancher.
How do I set up an equivalent network like the above command in Kubernetes?</p>
<p>If you want more information about what this network should do you can find it <a href="https://github.com/simple-login/app#prepare-the-docker-network" rel="nofollow noreferrer">here</a>.</p>

Job
<p>You don't.  Kubernetes has its own network ecosystem, which mostly acts as though every Pod and Service is on the same network.  You can't create separate subnets within that, there's no way to create a separate network per logical application.  You also can't control the IP range of networks in Kubernetes (it shouldn't usually be necessary in Docker either).</p>
<p>Generally you can communicate between Kubernetes Pods by putting a Service in front of each, and then using the Service's <a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/" rel="nofollow noreferrer">DNS name</a> as a host name.  If all of the parts were running in the same Namespace, and the Service in front of the database were named <code>sl-db</code>, then the webapp Pod could use <code>sl-db</code> as the host name part of the <code>DB_URI</code> setting.</p>
<p>Reading through the documentation you link to, you will probably need to do some extra work to get the Postfix MTA set up.  Note that it looks like it runs outside of Docker in this setup; either you will have to port the setup to run inside Kubernetes or configure its <code>mynetworks</code> settings to include the network that contains the Kubernetes nodes.  You will also need to set up Kubernetes ConfigMaps and Secrets to hold the various configuration files and certificates this setup needs.</p>
