I wasn’t sure either, just grabbed the Swarm config from the wiki
# docker-stack.yml
elasticsearch:
environment:
# Force publishing on the 'elk' overlay.
network.publish_host: _eth0_
# Set a predictable node name.
node.name: elk_elasticsearch.{{.Task.Slot}}
# Disable single-node discovery.
discovery.type: ''
# Use internal Docker round-robin DNS for unicast discovery.
discovery.seed_hosts: tasks.elasticsearch
# Define initial masters, assuming a cluster size of at least 3.
cluster.initial_master_nodes: elk_elasticsearch.1,elk_elasticsearch.2,elk_elasticsearch.3