<p><b>Disclosure :</b>
<br> </p>

<ul>
<li>I have few questions for the containerization and orchestration tools
available today in the market.</li>
<li>I have worked on docker swarm,
kubernetes, and Elastic Bean Stalk.</li>
</ul>

<p><b>Problem</b>: I want to automate scaling without having to deal with ec2 instances where I don't have to worry about of scaling of instances. I know that GKE provides that but I want to stick with the AWS. The system where I can define scaling triggers based on requests, memory, CPU on the dashboard (same as elastic-beanstalk but I will need to run multiple services. all services will have different scaling triggers ). From what I read, One common thing is kubernetes and ECS is that I have to write scripts based on cloud-watch events. </p>

<hr>

<p><b>Q.1: For Docker Swarm:</b>
<br><br>
   How is Docker Swarm better to balance the load and auto scale when I have to already provide more than 1 Virtual machines (created by docker-machine) as workers for my manager?
<br><br>
<b>My View:</b>
<br></p>

<ul>
<li>This is cost wise not good as I will have to anyway pay for this 2
instances. </li>
<li>This VM's will still remain present when there is a low
load.</li>
<li>I don't think except a manually running script there won't be
any auto-scaling possible here.</li>
<li>I will be managing a single docker-compose.yml here.</li>
</ul>

<hr>

<p><b>Q.2: For Kubernetes:</b>
<br><br>
   Does Kubernetes scale up on instance level?
<br><br>
<b>My View:</b>
<br></p>

<ul>
<li>Kubernetes provides options for Autoscaling (like horizontal scaling
etc.)  but this all happens on service level, in the end, there will
be multiple pods and containers </li>
<li>As per I know everything will happen
in Kubernetes Cluster managed by Kops on production, So if it scales on instance level how does it do? as it doesn't have any virtual machine concept like SWARM in docker. </li>
<li>I will be managing multiple YAML files here based on my services.</li>
</ul>

<hr>

<p><b>Q.3 For Elastic Bean Stalk:</b>
<br><br>
   If Elastic Bean Stalk can manage my Entire Containerization along with AutoScaling and Load Balancing then how are above 2 so much in demand and better to use?
<br><br>
<b>My View:</b>
<br></p>

<ul>
<li>Elastic Bean Stalk is more moving towards Fargate nowadays which not
available for all zones at present.</li>
<li>I have seen in the process that it gives full control by providing a complete configuration dashboard based on my services.</li>
<li>It will create a new Instance as per my load and autoscale.</li>
</ul>

<hr>

<p><i>
I am confused and <b>unable to convince</b> people who say No to Kubernetes and Docker Swarm,
If Someone can Please provide me a detailed overview of What and Why to use in production on AWS? as I don't answer for majorly AutoScaling and LoadBalancing on Production even though knowing this tools above. 
</i></p>

<blockquote>
  <p>Questions listed above consider AWS as the cloud deployment platform also I would like to let you know that I have a successfully running docker-compose.yml over Docker Swarm and 4 different YAML files for Kubernetes which also work great on Minikube.</p>
</blockquote>

<blockquote>
  <p>I am confused and unable to convince people who say No to Kubernetes and Docker Swarm, If Someone can Please provide me a detailed overview of What and Why to use in production on AWS? </p>
</blockquote>

<p>Two out of three solutions provided by you are platform-agnostic, so we can talk about them without concentration on AWS.</p>

<p>I recommend you to use Kubernetes, and I will try to explain why below.</p>

<blockquote>
  <p>How is Docker Swarm better to balance the load and auto scale when I have to already provide more than 1 Virtual machines (created by docker-machine) as workers for my manager? </p>
</blockquote>

<p>Docker Swarm is a relatively simple platform for orchestration of Docker applications with quite simple logic. To implement node-based autoscaling, you should use some external tools (in AWS, for instance, you can use an Autoscale group with some rules based on CPU load). And you will have to add some custom scripts to add and remove nodes from Docker Swarm cluster. All that things are possible, but you will need to develop it yourself.</p>

<blockquote>
  <p>Does Kubernetes scale up on instance level? </p>
</blockquote>

<p>Yes, it does. Kubernetes can scale using <a href="https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler" rel="noreferrer">cluster-autoscale</a> daemon, which can run inside a cluster, and automatically scale your instances up and down based on several metrics, including custom ones. You do not have to create any scripts, all logic is already implemented, you just need to setup rules.</p>

<blockquote>
  <p>If Elastic Bean Stalk can manage my Entire Containerization along with AutoScaling and Load Balancing then how are above 2 so much in demand and better to use? </p>
</blockquote>

<p>Elastic Beanstalk is a solution to run applications inside AWS, but you will be limited by its functions. Yes, it can do so many things for you, but if you will need something custom or you will need to create a hybrid cloud solution - that is not an option.</p>

<p>Finally, I can tell you that with Kubernetes you will get:</p>

<ol>
<li>Tons of documentation and community experience.</li>
<li>Auto-magic for almost everything, from auto-scaling to A/B testing, and auto-signing Let's Encrypt certifications for your services. You will spend a lot of time implementing all that features in Docker Swarm or Elastic Beanstalk, and some of them can be almost impossible in other orchestrators. </li>
<li>Platform agnostics. You can migrate to any platform (even to on-premise) with minimal changes in configurations of your applications. Docker Swarm is also working almost everywhere, but it is less functional. </li>
<li>A lot of other things for scheduling, jobs, application distribution, different types of volumes, and many more.</li>
</ol>

<p>Also, I can recommend you some Kubernetes modules and apps which can be useful for you on (not only) AWS.</p>

<ul>
<li><a href="https://github.com/jtblin/kube2iam" rel="noreferrer">Kube2iam</a> tool which provides you with AWS IAM role, assigning it directly to your pods, not instances.</li>
<li><a href="https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler" rel="noreferrer">Autoscaling</a> module.</li>
<li><a href="https://github.com/jetstack/cert-manager/" rel="noreferrer">Cert-manager</a> to generate LetsEncrypt SSL keys. It has Route53 integration for DNS challenge.</li>
<li><a href="https://github.com/kubernetes/ingress-nginx" rel="noreferrer">Nginx-ingress</a> as ingress controller which provides you with a lot of features and the best Nginx experience.</li>
<li><a href="https://github.com/kubernetes/kops" rel="noreferrer">Kops</a>. But you already know it.</li>
</ul>
