Anybody knows some examples of creating a docker s...
# getting-started
b
Anybody knows some examples of creating a docker swarm cluster on aws?
s
If you can find an AMI that has a sufficiently recent enough version of Docker pre-installed, then you could instantiate some number of EC2 instances using that AMI and then use the
Command
module to run the Docker commands necessary to establish a Swarm cluster.
b
how do i get return from
docker swarm init
, which is needed for the worker nodes?
s
If you’re using
command.remote.Command
(see https://www.pulumi.com/registry/packages/command/api-docs/remote/command/) there are
stdout
and
stderr
outputs that should capture the return of the
docker swarm init
command. You’ll have to parse it down to what you need, and then pass that information on to create the worker nodes.
BTW, the reason I suggested the
Command
module is because the current Docker provider does not have any functionality for establishing a Swarm cluster.
b
got you, thanks
I checked the command module, it needs direct ssh access. Usually I setup worker er2 instances to have only private ip addresses. Any suggestion? @salmon-account-74572
s
Use an SSH bastion?
b
I don't see how to set up bastion host in command module.
the manager node has public ip, can be the jump host, in my setup
s
Sorry---bastion host (or jump host) isn’t part of the Command module, Using a node with a public IP, as you’ve suggested, is what I meant. Apologies that I wasn’t more clear.
b
trying to work around this issue now
thanks