registers docker swarm nodes with a route53 hostedzone [AWS]
814
registers swarm nodes with a route53 hostedzone.
Example Zone: acme.tld
docker run --rm \
-e SWARM_NAME=alpha \
-e AWS_DEFAULT_REGION=us-east-2 \
-e HOSTED_ZONE_ID=Z3463YG518IZIW \
-e SWARM_DOMAIN=swarms.acme.tld \
swarm53
| Record | Name | Value(s) | Description |
|---|---|---|---|
| A | alpha.swarms.acme.tld. | 18.12.6.0.1 18.12.6.0.2 18.12.6.0.3 18.12.6.0.4 18.12.6.0.5 | Public IP of all nodes in acme swarm |
| A | managers.alpha.swarms.acme.tld. | 18.12.6.0.1 18.12.6.0.2 | Public IP of all managers |
The swarm53 container can be invoked in monitor mode. When the swarm topology changes, swarm53 will update DNS records after a brief 30 second delay to allow instance termination.
swarm53-monitor enable monitor mode.docker run --rm .... \
-v /var/run/docker.sock:/var/run/docker.sock \
--entrypoint swarm53-monitor \
swarm53
| Tag | Description | Example |
|---|---|---|
| SwarmName | unique name of swarm | 'alpha' |
| Role | node role | 'swarm-manager' or 'swarm-worker' |
Policy must grant ec2:DescribeInstances and route53:ChangeResourceRecordSets prermissions.
Example policy JSON granting access explicitly to the hosted zone Z3463YG518IZIW:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"route53:ChangeResourceRecordSets",
],
"Resource": [
"arn:aws:route53:::hostedzone/Z3463YG518IZIW",
]
},
{
"Effect": "Allow",
"Action": "ec2:DescribeInstances",
"Resource": "*"
}
]
}
Content type
Image
Digest
Size
35.2 MB
Last updated
over 8 years ago
docker pull briceburg/swarm53