Creating a Docker Container Cluster with Container Service
In this tutorial, we’ll show you how to create an Alibaba Cloud Container Service cluster — made up of a Virtual Private Cloud (VPC) of Alibaba Cloud Elastic Compute Service (ECS) instances. This is a prerequisite step towards running Alibaba Cloud’s Container Service for managing Docker Swarm environments.
In the past, developers had to install, run, and monitor systems on physical machines in server rooms. Now, containerization with virtual management tools, such as Docker Swarm and Kubernetes, allows developers to manage and monitor production and development environments made up of Docker application containers built directly into the Alibaba Cloud Container Service.
What Is Alibaba Cloud’s Container Service?
Alibaba Cloud’s Container Service is a scalable, high-performance, container management service that allows you to orchestrate and manage containerized application lifecycles with either Docker Swarm or Kubernetes.
Alibaba Cloud’s Container Service offers multiple application release methods, including continuous integration, and also supports a microservices architecture. By simplifying the UI setup of a container cluster, which integrates with Alibaba Cloud’s virtualization, storage, network, and security services, Alibaba Cloud’s Container Service is the perfect cloud environment for running, managing, and monitoring containerized application environments.
What Is Docker Swarm?
Docker is an open source, virtualization management tool that allows you to develop, deploy, manage, and monitor applications and systems within containers. This process is known as containerization. Docker Swarm is a clustering, scheduling, and orchestration tool for systems and environments that run on multiple and scalable Docker containers.
A Docker container is launched by running a Docker image which is an executable package that includes everything needed for running an entire application: code, runtime, libraries, environment variables, and configuration files. A container is a runtime instance of a Docker image.
You can run multiple containers at the same time on the same instance, or a cluster swarm of instances, and the containers are managed by Docker instead of an operating system’s hypervisor. This provides redundancy and failover if one or more cluster nodes experience issues.
Docker is lightweight and efficient and can manage the most complex systems built up of multiple applications. You can build Docker containers locally, deploy them to the cloud, and run them anywhere; scaling up and down wherever necessary.
Docker is easy to set up, install, and run on a single ECS instance. A large-scale containerized environment running industry-level applications and systems needs a reliable and scalable orchestration and monitoring system. Alibaba Cloud’s Container Service provides system administrator and DevOps teams with the clustered architectures they need to manage extensive containerized environments.
Why Do I Need to Create a Cluster?
Before we can install a suite of running Docker containers with Alibaba Cloud’s Container Service, we need to have an Alibaba Cloud Container Service Docker Swarm cluster ready and available for implementing our containerized systems.
This tutorial explains the preliminary step of building out such a cluster. Our following tutorial will show you how to implement Docker images on the Docker Swarm cluster with Alibaba Cloud’s Container Service.
You will need an Alibaba Cloud account. If you don’t already have one, head over to the Free Trial page to get access to $300 worth of Alibaba Cloud products to play around with in the Alibaba Cloud New User Free Trial.
Let’s get started.
Creating a Cluster
First, head over to the Products page and click Container Service.
You will arrive at the Container Service console page.
Make sure the Container Service Swarm option is selected before clicking Create Cluster.
Give your Cluster a unique name and pick your Region and Zone.
Check the cluster’s VPC details and the Initial CIDR Block range of IPs.
You can add existing ECS instances to the cluster or create new ones. Let’s create four small instances for the cluster in this tutorial.
Add extra data storage as required — but each ECS instance does come with a minimum of storage.
You can choose between Ubuntu or Centos for operating systems.
You can set a key pair for secure access or set the root password for accessing the instances as required.
We’ll keep the public IP addresses (EIPs) configured by leaving the option unchecked and install the cloud monitoring plug-in on the instances too.
The cluster is set to automatically create a Server Load Balancer.
You can select previously set up Relation Database Service (RDS) instances on the cluster if required and the cluster creation process gives you a security group set for the relevant protocol types on the Virtual Private Cloud (VPC).
When you are happy with the configuration details, click Create at the top of the page.
Once you have clicked Create, you will see a page summarizing the Cluster Configuration details and asking for your confirmation.
When you are satisfied that the cluster configuration is appropriate for your needs, click OK.
The request is submitted. You will see a report log while the cluster is being created.
If you notice a warning that you have not yet activated a service you may need, go ahead and do so.
Once the cluster is created, you will see the confirmation on screen.
Click Back to Cluster List.
You will see the cluster available and Running in the Cluster List.
Now, when you click through to Overview, you will see a graphical representation of the cluster.
Click through to Nodes and you will see a list of the ECS instances that make up the cluster including their public and private IP addresses, their statuses, and more configuration information.
The Application, Service, and Container sections in our example list information on the default build system applications and services, as well as the seven containers included automatically per instance.
We are now ready to set up a Docker Swarm containerized system on the Alibaba Cloud Container Service cluster we have just created.
First, we told you that we were going to build a cluster to run an Alibaba Cloud Container Service application environment and that, for this tutorial, it will be a Docker Swarm cluster. In a future tutorial, we will build a cluster for the Container Service Kubernetes option too.
We then gave a brief insight into Alibaba Cloud’s Container Service product and how its high performance, scalability, and easy to use console is the perfect way to integrate containerized application environments with Alibaba Cloud’s vast range of products and services.
We explained that, for this first part of the tutorial pair, we build the Docker Swarm cluster which will then allow us to build out a Docker Swarm application with a selection of Docker containers that make up a running application.
We finally went step-by-step through the process of building an Alibaba Cloud Container Service Docker Swarm cluster, explaining the configuration options as we went along.
Don’t forget to check out the next tutorial which will show you how to build a running application environment on a Docker Swarm cluster with Alibaba Cloud’s Container Service.