elasticsearch-masters:
  image: rancher/elasticsearch-conf:v0.5.0
  labels:
    io.rancher.container.hostname_override: container_name
    io.rancher.sidekicks: elasticsearch-base-master,elasticsearch-datavolume-masters
  volumes_from:
    - elasticsearch-datavolume-masters
elasticsearch-datavolume-masters:
  labels:
    elasticsearch.datanode.config.version: '0'
    io.rancher.container.hostname_override: container_name
    io.rancher.container.start_once: true
  volumes:
    - /usr/share/elasticsearch/data
    - /usr/share/elasticsearch/config
    - /opt/rancher/bin
  entrypoint: /bin/true
  image: elasticsearch:2.4.3-alpine
elasticsearch-base-master:
  labels:
    elasticsearch.master.config.version: '0'
    io.rancher.container.hostname_override: container_name
  image: elasticsearch:2.4.3-alpine
  net: "container:elasticsearch-masters"
  volumes_from:
    - elasticsearch-datavolume-masters
  entrypoint:
    - /opt/rancher/bin/run.sh


elasticsearch-datanodes:
  image: rancher/elasticsearch-conf:v0.5.0
  labels:
    io.rancher.container.hostname_override: container_name
    io.rancher.sidekicks: elasticsearch-base-datanode,elasticsearch-datavolume-datanode
    io.rancher.scheduler.affinity:container_label_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name}
  links:
    - elasticsearch-masters:es-masters
  volumes_from:
    - elasticsearch-datavolume-datanode
elasticsearch-datavolume-datanode:
  labels:
    elasticsearch.datanode.config.version: '0'
    io.rancher.container.hostname_override: container_name
    io.rancher.container.start_once: true
  volumes:
    - /usr/share/elasticsearch/data
    - /usr/share/elasticsearch/config
    - /opt/rancher/bin
  entrypoint: /bin/true
  image: elasticsearch:2.4.3-alpine
elasticsearch-base-datanode:
  labels:
    elasticsearch.datanode.config.version: '0'
    io.rancher.container.hostname_override: container_name
  image: elasticsearch:2.4.3-alpine
  links:
    - elasticsearch-masters:es-masters
  entrypoint:
    - /opt/rancher/bin/run.sh
  volumes_from:
    - elasticsearch-datavolume-datanode
  net: "container:elasticsearch-datanodes"


elasticsearch-clients:
  image: rancher/elasticsearch-conf:v0.5.0
  labels:
    io.rancher.container.hostname_override: container_name
    io.rancher.sidekicks: elasticsearch-base-clients,elasticsearch-datavolume-clients
  links:
    - elasticsearch-masters:es-masters
  volumes_from:
    - elasticsearch-datavolume-clients
elasticsearch-datavolume-clients:
  labels:
    elasticsearch.datanode.config.version: '0'
    io.rancher.container.hostname_override: container_name
    io.rancher.container.start_once: true
  volumes:
    - /usr/share/elasticsearch/data
    - /usr/share/elasticsearch/config
    - /opt/rancher/bin
  entrypoint: /bin/true
  image: elasticsearch:2.4.3-alpine
elasticsearch-base-clients:
  labels:
    elasticsearch.client.config.version: '0'
    io.rancher.container.hostname_override: container_name
  image: elasticsearch:2.4.3-alpine
  volumes_from:
    - elasticsearch-datavolume-clients
  net: "container:elasticsearch-clients"
  entrypoint:
    - /opt/rancher/bin/run.sh


kopf:
  image: rancher/kopf:v0.4.0
  ports:
    - "${kopf_port}:80"
  environment:
    KOPF_SERVER_NAME: 'es.dev'
    KOPF_ES_SERVERS: 'es-clients:9200'
  labels:
    io.rancher.container.hostname_override: container_name
  links:
    - elasticsearch-clients:es-clients
