This is sample build docker swarm cluster over TLS using Terraform on DigitalOcean.
Shell HCL
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
provision
.gitignore
LICENSE
README.md
terraform.tf
terraform.tfvars.sample

README.md

Build docker swarm over TLS using Terraform

This is sample build docker swarm cluster over TLS using Terraform on DigitalOcean.

Refs: TLS認証なDocker Swarmクラスタを構築 (docker-machineなしで)

Get Started

setting

cp terraform.tfvars.sample terraform.tfvars
vi terraform.tfvars

plan and apply

terraform plan
terraform apply

it output tls keys to keys directory.

e.g. docker usage

docker --tlsverify \
  --tlscacert=keys/ca.pem \
  --tlscert=keys/cert.pem \
  --tlskey=keys/key.pem \
  -H=(ipv4_address of first host):3376 \
  info

or

export DOCKER_TLS_VERIFY="1"
export DOCKER_CERT_PATH="/path/to/keys"
export DOCKER_HOST="(ipv4_address of first host):3376"

docker info

License

MIT