I am having issues while running ELK on docker, behind Traefik. Every other services are running, but when i try to access to kibana on a browser via its url, I got a 404.
This is my docker-compose.yml :
version: '3.4'
networks:
app-network:
name: app-network
driver: bridge
ipam:
config:
- subnet: xxx.xxx.xxx.xxx/xxx
services:
reverse-proxy:
image: traefik:v2.5
command:
--providers.docker.network=app-network
--providers.docker.exposedByDefault=false
--entrypoints.web.address=:80
--entrypoints.websecure.address=:443
--providers.docker=true
--api=true
--api.dashboard=true
ports:
- "80:80"
- "443:443"
networks:
app-network:
ipv4_address: xxx.xxx.xxx.xxx
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /certs/:/certs
labels:
- traefik.enable=true
- traefik.docker.network=public
- traefik.http.routers.traefik-http.entrypoints=web
- traefik.http.routers.traefik-http.service=api@internal
elasticsearch:
hostname: elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:7.12.0
environment:
- bootstrap.memory_lock=true
- cluster.name=docker-cluster
- cluster.routing.allocation.disk.threshold_enabled=false
- discovery.type=single-node
- "ES_JAVA_OPTS=-Xms2048m -Xmx2048m"
ulimits:
memlock:
hard: -1
soft: -1
volumes:
- esdata:/usr/share/elasticsearch/data
ports:
- 9200:9200
networks:
app-network:
ipv4_address: xxx.xxx.xxx.xxx
healthcheck:
interval: 20s
retries: 10
test: curl -s http://localhost:9200/_cluster/health | grep -vq '"status":"red"'
labels:
- "traefik.enable=true"
- "traefik.http.routers.elasticsearch.entrypoints=http"
- "traefik.http.routers.elastic.rule=Host(`elastic.mydomain.fr`)"
- "traefik.http.services.elastic.loadbalancer.server.port=9200"
kibana:
hostname: kibana
image: docker.elastic.co/kibana/kibana:7.12.0
depends_on:
elasticsearch:
condition: service_healthy
environment:
ELASTICSEARCH_URL: http://elasticsearch:9200
ELASTICSEARCH_HOSTS: http://elasticsearch:9200
ports:
- 5601:5601
networks:
app-network:
ipv4_address: xxx.xxx.xxx.xxx
links:
- elasticsearch
healthcheck:
interval: 10s
retries: 20
test: curl --write-out 'HTTP %{http_code}' --fail --silent --output /dev/null http://localhost:5601/api/status
labels:
- "traefik.enable=true"
- "traefik.http.routers.kibana.entrypoints=http"
- "traefik.http.routers.kibana.rule=Host(`kibana.mydomain.fr`)"
- "traefik.http.services.kibana.loadbalancer.server.port=5601"
- "traefik.http.routers.kibana.entrypoints=websecure"
volumes:
esdata:
driver: local
Knowing that, as I said, Elastic and other services can be accessed.
I have already tried to set the basePath, but it did not works either.
Do you have any idea what am I missing ?