Containerisation and Orchestration which Tool to use and why

4/5/2018

Disclosure :

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

Problem: 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.


Q.1: For Docker Swarm:

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?

My View:

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

Q.2: For Kubernetes:

Does Kubernetes scale up on instance level?

My View:

  • 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
  • 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.
  • I will be managing multiple YAML files here based on my services.

Q.3 For Elastic Bean Stalk:

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?

My View:

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

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? as I don't answer for majorly AutoScaling and LoadBalancing on Production even though knowing this tools above.

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.

-- Naitik Shah
amazon-cloudformation
amazon-elastic-beanstalk
docker
docker-swarm
kubernetes

1 Answer

4/5/2018

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?

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

I recommend you to use Kubernetes, and I will try to explain why below.

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?

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.

Does Kubernetes scale up on instance level?

Yes, it does. Kubernetes can scale using cluster-autoscale 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.

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?

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.

Finally, I can tell you that with Kubernetes you will get:

  1. Tons of documentation and community experience.
  2. 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.
  3. 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.
  4. A lot of other things for scheduling, jobs, application distribution, different types of volumes, and many more.

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

  • Kube2iam tool which provides you with AWS IAM role, assigning it directly to your pods, not instances.
  • Autoscaling module.
  • Cert-manager to generate LetsEncrypt SSL keys. It has Route53 integration for DNS challenge.
  • Nginx-ingress as ingress controller which provides you with a lot of features and the best Nginx experience.
  • Kops. But you already know it.
-- Anton Kostenko
Source: StackOverflow