https://github.com/softonic/docker-aws-elb
Registers current node to a set of AWS ELBs
https://github.com/softonic/docker-aws-elb
aws docker elb swarm
Last synced: 30 days ago
JSON representation
Registers current node to a set of AWS ELBs
- Host: GitHub
- URL: https://github.com/softonic/docker-aws-elb
- Owner: softonic
- License: other
- Created: 2017-09-13T14:37:56.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-12-10T08:32:50.000Z (over 6 years ago)
- Last Synced: 2025-02-14T04:51:19.590Z (over 1 year ago)
- Topics: aws, docker, elb, swarm
- Language: Dockerfile
- Homepage: https://hub.docker.com/r/softonic/aws-elb/
- Size: 6.84 KB
- Stars: 0
- Watchers: 7
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AWS ELB Autoconfigure
This image has been designed to auto-register in a set of AWS ELBs the nodes of a swarm cluster.
## Description
It can register automatically each node that joins to the cluster.
## Usage
A sample stack is provided for simplification:
``` yaml
version: "3.3"
services:
elb-autoconfigure:
image: softonic/aws-elb:latest
environment:
AWS_ELB_NAMES: "${AWS_ELB_NAMES}"
volumes:
- /var/run/docker.sock:/var/run/docker.sock,readonly
deploy:
mode: global
restart_policy:
condition: none
resources:
limits:
cpus: '0.10'
memory: 50M
reservations:
cpus: '0.05'
memory: 10M
secrets:
- source: "aws.credentials.v1"
target: "/root/.aws/credentials"
uid: "0"
gid: "0"
mode: 0400
configs:
- source: aws.config.v1
target: "/root/.aws/config"
uid: '0'
gid: '0'
mode: 0400
configs:
aws.config.v1:
external: true
secrets:
aws.credentials.v1:
external: true
```
### Auto registration of nodes
This can be deployed as a global service, then each time a new node joins the cluster it will launch the
auto registration process.
### Requirements
You need to create in the cluster two different files. One is for the configuration of the AWS. for example this could work:
``` bash
# cat ~/.aws/config
echo "[default]
output = json
region = eu-west-1
" | docker config create aws.config.v1 --label aws -
# cat ~/.aws/credentials
echo "[default]
aws_access_key_id = ${AWS_ACCESS_KEY_ID}
aws_secret_access_key = ${AWS_SECRET_ACCESS_KEY}
" | docker secret create aws.credentials.v1 --label aws -
export AWS_ELB_NAMES="Swarm swarm-private"
docker stack deploy --compose-file docker-compose.yml elb-autoconfigure
```