0

I use docker-compose v3 file to deploy services on docker swarm mode cluster. My services are elasticsearch and kibana. I want that kibana was accessible from outside, and that elasticsearch could be accessed by kibana and was not visible and accessible from outside. In order to reach this kind of behavior, I created 2 overlay networks called 'external' and 'elk_only'. I put elasticseach on 'elk_only' network and I placed kibana under 'elk_only' and 'external' networks. And the things do not work. When I go to localhost:5601 (kibana's port), I get a message: 'localhost refused to connect'.

The command I use to deploy services is

docker stack deploy --compose-file=elastic-compose.yml elkstack

The content of elastic-compose.yml file:

version: "3"
services:
elasticsearch:
image: elasticsearch:5.1
expose:
  - 9200
networks:
  - elk_only
deploy:
  restart_policy:
    condition: on-failure
kibana:
image: kibana:5.1
ports:
  - 5601:5601
volumes:
  - ./kibana/kibana.yml:/etc/kibana/kibana.yml
depends_on:
  - elasticsearch
networks:
  - external
  - elk_only
deploy:
  restart_policy:
    condition: on-failure
networks:
  elk_only:
  driver: overlay
external:
driver: overlay

The content of kibana.yml is

server.port: 5601
server.host: "0.0.0.0"
elasticsearch.url: "http://elkstack_elasticsearch:9200"

Could you help me to solve this problem and understand what's going wrong? Any help would be appreciated!

kritikaTalwar
  • 1,730
  • 1
  • 17
  • 25
Shuffer
  • 1
  • 1
  • From my point of view the 2 networks just make sense if you got a reverse proxy in the external lan (eg. jwilder nginx), otherwise you do not need the external network... BR – Berndinox Jan 30 '17 at 13:54
  • yes, in future i suppose to have an external net with traefik reverse proxy, this question is kind of a preparation step to that. – Shuffer Jan 30 '17 at 15:02
  • Ok. Is the Service available internally? - docker inspect kibana-ID to get the IP, then curl Kibana-Container-IP 5601 – Berndinox Jan 30 '17 at 15:11

0 Answers0