Azure Container Service

Microsoft Azure Container Service (ACS) is an Azure Resource Provider for creating and managing a cluster of machines that act as container hosts. ACS makes it extremely easy to provision a production-ready cluster using popular open source cluster management and scheduling tools.

A single resource provider can be used to provision a Mesos or Docker Swarm cluster, which are some technologies we will cover later in this chapter, in the scheduling section. The ACS resource provider requires only a handful of properties to deploy an entire cluster. The properties can even be defined at deployment using ARM template parameters and variables discussed earlier in this chapter.

ACS Resource Provider

The following ARM resource snippet could be used to provision a cluster in Azure using a configurable set of parameters. Note the resource type defined is “Microsoft.ContainerService/containerService.” A location is provided which will place it in the same location in which the resource group was created, and the name of this resource will simply prepend “containerservice-” to the resource group name. The more interesting parts are the properties of the resource provider, where the values for the properties are being set using ARM variables.

ACS Resource Provider Properties:

orchestrationProfile element is used to define the type of orchestration tooling to deploy.

masterProfile element is where we can define properties for the master nodes, such as the number of nodes to create, and a prefix used for creating DNS entries for the master node load balancer.

agentPoolProfiles element enables us to define multiple collections of agent nodes, each having a different name, count, size, and dnsPrefix.

linuxProfile element is where we can define system property settings for all the nodes provisioned, like the credentials.

{
  "apiVersion": "2015-11-01-preview",
  "type": "Microsoft.ContainerService/containerServices",
  "location": "[resourceGroup().location]",
  "name":"[concat('containerservice-',resourceGroup().name)]",
  "properties": {
    "orchestratorProfile": {
      "orchestratorType": "Mesos"
    },
    "masterProfile": {
      "count": "[variables('masterCount')]",
      "dnsPrefix": "[variables('mastersEndpointDNSNamePrefix')]"
    },
    "agentPoolProfiles": [
      {
        "name": "agentpools",
        "count": "[variables('agentCount')]",
        "vmSize": "[variables('agentVMSize')]",
        "dnsPrefix": "[variables('agentsEndpointDNSNamePrefix')]"
       }
     ],
     "linuxProfile": {
      "adminUsername": "[variables('adminUsername')]",
      "ssh": {
        "publicKeys": [
          {
            "keyData": "[variables('sshRSAPublicKey')]"
          }
        ]
      }
    }
  }
}

As we can see here, Microsoft Azure makes it very easy to provision production-ready Mesos and Docker Swarm clusters.

The flak.io sample application includes detailed steps for provisioning a new cluster and deploying the flak.io ecommerce sample into the cluster at http://flak.io.

Deploying an ARM Template to Azure

Azure supports several methods for deploying templates, including PowerShell, the Azure Command Line Interface (CLI), or a standard REST API. PowerShell and Azure CLI require you to log into your Azure account and select the subscription that you want to deploy to. You will also need to create a new resource group if you don’t already have one available. Using a parameter file, you can deploy your ARM template with the following commands:

PowerShell:

C:> New-AzureResourceGroupDeployment -Name ExampleDeployment
-ResourceGroupName ExampleResourceGroup -TemplateFile
<PathOrLinkToTemplate> -TemplateParameterFile
<PathOrLinkToParameterFile>

Azure CLI:

azure group deployment create -f <PathToTemplate> -e
<PathToParameterFile> -g ExampleResourceGroup -n ExampleDeployment

Deploying an ARM Template from Version Control

We can deploy directly from a publicly accessible Git repository by providing the template’s URI:

azure group deployment create --template-uri <repository item URI>

For example, the Azure CLI command for deploying a new storage account using the Azure GitHub repository would look similar to the following:

azure group deployment create --template-uri
https://raw.githubusercontent.com/Azure/azure-quickstart-templates/
master/101-create-storage-account-standard/azuredeploy.json

For more information on Azure Resource Manager, including guidance and best practices, take a look at the product documentation at https://azure.microsoft.com/en-us/documentation/articles/resourcegroup-overview/.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.37.20