Swarm Azure Container Service

Posted: November 16, 2017 in Azure

In one of my previous posts i described Kubernetes Azure cluster, in this one we’ll create Swarm container.

As i already described in Kubernetes post, we need to create public/private key, so i won’t go into much details here,we need to use PuTTy generator, save private key also.

2.jpg

New-Containers-Azure-Container Service

1.png

Copy public key from PuTTy generator, specify username

3.PNG

4.png

Agent count: For Docker Swarm and Kubernetes, this value is the initial number of agents in the agent scale set. For DC/OS, it is the initial number of agents in a private scale set. Additionally, a public scale set is created for DC/OS, which contains a predetermined number of agents. The number of agents in this public scale set is determined by the number of masters in the cluster: one public agent for one master, and two public agents for three or five masters

After Cluster is installed, we need to get public DNS name, on cluster properties click Overview

5.png

In PuTTY specify this name and port 2200

5-2.PNG

and specify private key saved in same step when creating public key

5-3.PNG

Check Swarm agent configuration:

docker -H 172.16.0.5:2375 info

root@swarm-master-BBDA4078-0:/home/ja# docker -H 172.16.0.5:2375 info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Role: primary
Strategy: spread
Filters: health, port, dependency, affinity, constraint
Nodes: 2
swarm-agent-BBDA4078000000: 10.0.0.4:2375
└ Status: Healthy
└ Containers: 0
└ Reserved CPUs: 0 / 2
└ Reserved Memory: 0 B / 4.036 GiB
└ Labels: executiondriver=, kernelversion=3.19.0-65-generic, operatingsystem=Ubuntu 14.04.4 LTS, storagedriver=overlay
└ Error: (none)
└ UpdatedAt: 2017-11-16T19:45:33Z
swarm-agent-BBDA4078000001: 10.0.0.5:2375
└ Status: Healthy
└ Containers: 0
└ Reserved CPUs: 0 / 2
└ Reserved Memory: 0 B / 4.036 GiB
└ Labels: executiondriver=, kernelversion=3.19.0-65-generic, operatingsystem=Ubuntu 14.04.4 LTS, storagedriver=overlay
└ Error: (none)
└ UpdatedAt: 2017-11-16T19:45:37Z
Plugins:
Volume:
Network:
Log:
Swarm:
NodeID:
Is Manager: false
Node Address:
Kernel Version: 3.19.0-65-generic
Operating System: linux
Architecture: amd64
CPUs: 4
Total Memory: 8.073GiB
Name: 23325e0bd3f7
Docker Root Dir:
Debug Mode (client): false
Debug Mode (server): false
Experimental: false
Live Restore Enabled: false

WARNING: No kernel memory limit support

To avoid specifying target socket (172.16.0.5:2375) every time we’ll set environmental variable

export DOCKER_HOST=172.16.0.5:2375

Deploy web server:

docker run -d -p 80:80 nginx

 

7.PNG

Browse Swarm agent’s Public DNS,it will be used as connection point to our nginx container,in Swarm Cluster properties click on agents,copy public DNS

 

5-1.PNG

And use it for connection to container

6.PNG

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s