thojkooi / terraform-digitalocean-docker-swarm-mode

Terraform module for provisioning a Docker Swarm mode cluster on DigitalOcean
https://registry.terraform.io/modules/thojkooi/docker-swarm-mode/digitalocean
MIT License
62 stars 27 forks source link

dumb question... #20

Open ghost opened 6 years ago

ghost commented 6 years ago

does... this initialize / copy the certs?

thojkooi commented 6 years ago

It doesn't do anything fancy with certificates.

ghost commented 6 years ago

so... how would one set docker to connect to the swarm? does it listen on :2376 by default?

ghost commented 6 years ago

I've seen terraform-swarm generate certs, but don't know how to apply that same logic here.

thojkooi commented 6 years ago

You would have to have your Docker installation handle exposing the Docker deamon / API on port 2376, using user data, or through some configuration management tool such as puppet.

I've messed around a bit with trying to get Terraform itself to handle it today and will push some examples for it soon.

thojkooi commented 6 years ago

@toxik-io , I've pushed some work in progress changes on the overhaul branch, including an example:

https://github.com/thojkooi/terraform-digitalocean-docker-swarm-mode/tree/77d75b908567508e0579f49766ddcef93b945434/examples/usage

Details on how to generate the certificates using cfssl can be found in the certs/ directory in that example. It has a couple of shell scripts you can run that will generate a set of certificates and keys.