<p>I am trying to build a web application with Kubernetes and Amazon Web Service.
I believe there are many different approaches but I would like to ask for your opinions!</p>
<p>To make it simple, the app would be a simple web page that display information. User logs in, and based on filters, get specific information.</p>
<p>My reflection is on the k8s inside architecture:</p>
<ol>
<li>Can I put my whole application as a Pod? That way, cluster and node scalability would make the app available for each user by allocating each of them 1 pod. Is that good practice?</li>
<li>By following that logic, every different elements of my app would be a container. For instance, in a simple way, 1 container that contains the front of the app, 1 container that has the data access/management, 1 container for backend/auth etc</li>
</ol>
<p>So 1 user would &quot;consume&quot; 1 pod which containers' are discussing together to give the required data from the user. k8s would create a pod for every users, scaling up/down the nodes number etc...
But then, except for the data itself, everything would be dockerized and stored on ECR (Elastic Container Registry) right? And so no need for any S3/EBS/EFS in my opinion.</p>
<p>I am quite new at AWS and k8s, so please feel free to give honest opinions :) Feedback, good or bad, is always good to take.</p>
<p>Thanks in advance!</p>

Polmnop
<p>I'd recommend a layout where:</p>
<ul>
<li>Any container can perform its unit of work for any user</li>
<li>One container per pod</li>
<li>Each component of your application has its own (stateless) deployment</li>
</ul>
<p>It probably won't work well to try to put your entire application into a single multi-container pod.  This means the entire application would need to fit on a single node; some applications are larger than that, and even if it fits, it can lead to trouble with scheduling.  It also means that, if you update the image for any single container, you need to delete and recreate all of the containers, which could be more disruptive than you want.</p>
<p>Trying to create a pod per user also will present some practical problems.  You need to figure out how to route inbound requests to a particular user's pod, and keep requests within that user's set of containers; Kubernetes doesn't have any sort of native support for this.  A per-user pod will also keep using resources even if it's overnight or the weekend for that user and they're not using the application.  You would also need something with access to the Kubernetes API to create and destroy resources as new users joined your platform.</p>
<p>In an AWS-specific context you might consider using RDS (hosted PostgreSQL/MySQL) or S3 (object storage) for data storage (and again one database or S3 bucket shared across all customers).  ECR is useful, but as a place to store your Docker images; that is, your built code, but not any of the persisted data or running containers.</p>
