Docker Swarm Cluster using Azure Container Services
Azure Container Service (ACS) is an Azure Compute resource provider to create and manage a cluster of virtual machines that act as container hosts together with a number of “master” machines that are used to orchestrate your application containers. Currently ACS is in preview, and my subscriptions got access to the preview service last week. I will be exploring ACS and blogging about them.
ACS works with Apache Mesos as well as Docker Swarm. In this article, I am sharing my experience on creating Docker Swarm cluster on ACS. For build the service, I used the guidance provided at https://github.com/rgardler/azure-quickstart-templates/blob/acs/acs-docs/101%20Creating%20a%20Service%20using%20the%20Portal.md as the primary reference.
- Microsoft Azure Subscription enabled with ACS preview: If you need access, please request here – http://aka.ms/acspreview.
- Client (Git or Open SSH) to generate RSA Keys
- Create SSH RSA Public Key
- Deploy Swarm ACS Template
- Explore Resources in Container Service
Create SSH RSA Public Key
I used Git Client on my Windows Laptop to create the SSH key pair.
# Use ssh-keygen to create RSA key pair
# id_rsa and id_rsa.pub files are created in ~/.ssh folder
ssh-keygen –t rsa –b 2048
Open id_rsa.pub file, which has three parts (ssh-rsa <key> user@machinename). We need to copy all these content and provide as the SSHRSAPUBLICKEY, while deploying the template for ACS.
Deploy Swarm ACS Template
Open Browser and navigate to https://github.com/rgardler/azure-quickstart-templates/tree/acs/acs-swarm-full-template.
Click on Deploy to Azure button.
Provide parameter values for the custom deployment and click OK.
- DNSNAMEPREFIX: Unique DNS prefix
- AGENTCOUNT: You can choose 1 through 40. Provide 3.
- MASTERCOUNT: 1, 3 or 5 are allowed now. Choose 3.
- AGENTVMSIZE: For experiments, choose lower size (helps with reduced cost)
- SSHRSAPUBLICKEY: Ensure that you copy all the three parts created in previous step and provide here.
Choose to Create a new Resource Group, name it ACSExperiment.
Ensure that you choose Japan East
as the resource group location as this is the only supported region for ACS now.
Click on Legal Terms, review the terms and click Create.
Click on Create from the custom deployment blade.
Wait for the deployment to complete.
Explore Resources in Container Service
Once the template deployment is complete, open the Resource Group, ACSExperiment. You can see that there are four categories of resources.
- Azure Container Service Resource – Which manages all other resources
- A number of agent nodes with in an availability set for agents
- A number of master nodes with in an availability set for masters
- Availability set (one for agents and another for master)
In the next article, I will be going through in-detail on exploring the above resources, followed by publishing apps to Swarm cluster. J