Deploy an Azure Container Service cluster - Tips and Tricks


Deploying an Azure Container Service (ACS) cluster is fairly easy. You can use the Azure portal, PowerShell scripts or CLI command lines. You can find a good introduction to ACS at github. You can find step by step instructions below.

As I went through the processes of creating a Linux OS ACS cluster with Docker Swarm or Mesos DC/OS on a Windows 10 computer, I ran into a few gotchas and wanted to share them in the post.

#1 Find master and agent IP addresses or DNS names

You can find master and agent IP addresses or DNS names in different ways. But an easy way is use public IP address from the portal. You will need the master IP address or DNS name for the Putty program and the agent DNS name or FQDN for the browser.

image

 

#2 Set DOCKER_HOST variable when using Swarm orchestrator

Before executing “docker run” command, make sure that you define the Windows variable as shown below. Doing so, you are connecting the Docker client to the Docker swarm cluster.

export DOCKER_HOST=tcp://172.16.0.5:2375

image

 

You can view the app using the agent url.

image

#3 Use vi editor to compose the yml file when using Swarm orchestrator

You can use your favorite editor but vi happens to be mine. (I first used it on the mainframe while in the graduate school many years ago.)

- press [Esc] key anytime to return to command mode

- press i to insert text

- press [Esc] key and type ZZ to save and quit.

- press [Esc] key and type :wq [Enter] to save and quit.

- press [Esc] key and type :q! [Enter] to save and quit.

image

 

You can view the app using the agent url (port 8080).

image

#4 Use a different port than 80 for source port in Putty when using DC/OS orchestrator

If you have configured a web server on your Windows computer, for example, IIS Express, and port 80 has already been used, use a different port number e.g. 81 for the source port in the Putty utility. To check if port 80 has been used on your computer, simply type http://localhost in your local browser. If you see some content, you know the port has been taken.

 

image

 

#5 Use Marathon to create new application using DC/OS orchestrator

Launch Marathon from the browser, for example, http://localhost:81/marathon

image

 

Switching to JSON mode and paste json text. See one example below.

{
  "id": "nginx",
  "cpus": 0.1,
  "mem": 16.0,
  "instances": 1,
    "acceptedResourceRoles": [
    "slave_public"
  ],
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "nginx",
      "network": "BRIDGE",
      "portMappings": [
        { "containerPort": 80, "hostPort": 80, "servicePort": 9000, "protocol": "tcp" }
      ]
    }
  }
}

You can view the app using the agent url.

image


Comments (0)

Skip to main content