<p>I'm very new to the infrastructure so I built a simple monolith application and I use docker for building a container and deploy it on my linux server. My question is, do I need to install kubernetes for a single container and if no how can I scale or do the load balancing.</p>

Patrick
<p>&quot;<em>... do I need to install kubernetes for a single container</em>&quot; - No, it is not mandatory. One can use docker to manage applications. Kubernetes is a platform that <em>can</em> be used to orchestrate containerized applications. It offers tools and concepts like <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/" rel="nofollow noreferrer">autoscaling</a> based on load, isolation through <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/" rel="nofollow noreferrer">namespaces</a>, network access management through <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">services</a> and <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer">ingresses</a>, and much more. But Kubernetes is not the only platform for orchestration. There are others, for example <a href="https://www.openshift.com/" rel="nofollow noreferrer">OpenShift</a>, <a href="https://docs.docker.com/engine/swarm/" rel="nofollow noreferrer">docker swarm</a>, <a href="https://rancher.com/docs/rancher/v1.2/en/" rel="nofollow noreferrer">rancher</a>. All those are optional platforms with additional tooling and concepts that can be used if necessary.</p>
<p>&quot;<em>how can I scale or do the load balancing.</em>&quot; - We can, for example, define the replicas <a href="https://docs.docker.com/compose/compose-file/#replicas" rel="nofollow noreferrer">through the <code>replicas</code> variable in a <code>docker-compose</code> file</a>. All containers defined under a service are accessed through this service's name. How exactly the balancing is done can also be configured through the <a href="https://docs.docker.com/compose/compose-file/#endpoint_mode" rel="nofollow noreferrer"><code>endpoint_mode</code> configuration</a>. If we need even more control, we can deploy a separate load balancer, e.g. nginx. A possible configuration is described in <a href="https://medium.com/@benoittellier3/automatic-load-balancing-for-your-docker-compose-services-aa6b96f20d20" rel="nofollow noreferrer">this medium article</a>.</p>
<hr />
<p>For future posts, <a href="https://meta.stackexchange.com/questions/222735/can-i-ask-only-one-question-per-post">please limit yourself to one question per post</a>.</p>
