Ruan Bekker's Blog

From a Curious mind to Posts on Github

Run Kibana on Docker Swarm With Traefik

kibana

We will create a Kibana Service on Docker Swarm, that will sit behind a Traefik Reverse Proxy.

Create the Overlay Network:

1
$ docker network create --driver overlay appnet

Create the Traefik Service:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ docker service create \
--name traefik \
--constraint 'node.role==manager' \
--publish 80:80 \
--publish 443:443 \
--publish 8080:8080 \
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
--network appnet \
traefik:camembert \
--docker --docker.swarmmode  \
--docker.domain=apps.domain.com \
--docker.watch \
--logLevel=DEBUG \
--web

Set DNS:

Set a wildcard *.apps.domain.com to resolve to apps.domain.com, where apps.domain.com resolves to your swarm addresses

Create Kibana:

Create a Kibana Service and set the ELASTICSEARCH_URL to your External Elasticsearch Endpoint, take note that it uses port 9200 by default.

1
2
3
4
5
6
$ docker service create \
--name kibana \
--label 'traefik.port=5601' \
--network appnet \
--env KIBANA_ELASTICSEARCH_URL=elasticsearch.domain.com \
bitnami/kibana

Access Kibana:

Your Kibana endpoint will be available at: http://kibana.apps.domain.com

Resources: