Skip to main content

Overview

This template provides a production‑ready ELK Stack as a Monk runnable. You can:
  • Run it directly to get a managed ELK deployment with all necessary components
  • Inherit it in your own stack to seamlessly add logging, search, and analytics capabilities
The ELK Stack (Elasticsearch, Logstash, Kibana) is a powerful combination of tools for searching, analyzing, and visualizing log data in real time. This template includes Nginx as a reverse proxy for secure access to Kibana.

What this template manages

  • Elasticsearch container (search and analytics engine)
  • Logstash container (data processing pipeline)
  • Kibana container (visualization and management interface)
  • Nginx container (reverse proxy)
  • Network services on multiple ports
  • Persistent volumes for data storage
  • Custom configuration files for all components

Quick start (run directly)

  1. Load templates
  1. Run ELK stack with defaults
  1. Access Kibana
Once started, access Kibana through Nginx at http://localhost (default port 80). Running directly uses the defaults defined in this template’s variables. To customize settings like ports or JVM options, you should either:
  • Preferred: inherit and override variables as shown below
  • Alternative: fork/clone and edit the variables in elk/stack.yaml, then monk load MANIFEST and run

Configuration

Key variables you can customize in this template:
Data is persisted under ${monk-volume-path}/elasticsearch/data and ${monk-volume-path}/kibana/data on the host.

Configuration files

You can find configuration files in the /files directory: These files are automatically mounted into the containers. You can modify them before loading to customize the stack behavior. Inherit the ELK stack in your logging infrastructure and customize it:
Then run your app group:
Your application can now send logs to the Elasticsearch instance and visualize them through Kibana accessible at http://localhost:8080.

Stack components

The ELK stack includes the following runnables:
  • elk/elasticsearch - Search and analytics engine (ports 9200, 9300)
  • elk/kibana - Visualization interface (port 5601)
  • elk/logstash - Data processing pipeline (ports 5044, 50000, 9600)
  • elk/nginx - Reverse proxy (port 80)
All components are interconnected and start in the correct dependency order.

Ports and connectivity

  • Nginx proxy: TCP port 80 (configurable via nginx-listen-port)
    • Exposed to host for external access to Kibana
  • Elasticsearch HTTP API: TCP port 9200
    • Used by Kibana, Logstash, and applications
  • Elasticsearch internal: TCP port 9300
    • Internal cluster communication
  • Kibana: TCP port 5601
    • Proxied through Nginx
  • Logstash Beats: TCP port 5044
    • For receiving logs from Beats agents
  • Logstash TCP: TCP port 50000
    • For receiving logs via TCP
  • Logstash API: TCP port 9600
    • Monitoring and management
From other runnables in the same process group, use connection-hostname("\<connection-name>") to resolve component hostnames.

Persistence and configuration

Data paths (persisted to host volumes):
  • Elasticsearch data: ${monk-volume-path}/elasticsearch/data:/usr/share/elasticsearch/data
  • Kibana data: ${monk-volume-path}/kibana/data:/usr/share/kibana/data
These volumes ensure your data persists across container restarts and updates.

Features

  • Elasticsearch: Distributed search and analytics engine with single-node configuration by default
  • Logstash: Flexible data collection and transformation pipeline with customizable filters
  • Kibana: Rich visualization and exploration interface for your data
  • Nginx: Secure reverse proxy with customizable configuration for external access
  • Auto-connectivity: Components are pre-configured to communicate with each other
  • Health monitoring: Built-in health checks and dependency management

Logs and shell access

  • Integrate with monitoring tools (Prometheus, Grafana)
  • Use with alerting systems (PagerDuty, Slack, email)
  • Combine with log shippers (filebeat/, metricbeat/, fluentbit/)
  • Connect to application stacks for centralized logging

Troubleshooting

  • Ensure all required ports are available: Check that ports 80, 5601, 9200, 9300, 5044, 50000, and 9600 are not in use.
  • Verify JVM heap settings are appropriate for your system: The default 256MB may be too low for production workloads. Increase via elasticsearch-jvm-options and logstash-jvm-options.
  • Elasticsearch requires sufficient memory: If Elasticsearch fails to start, check available memory. Production deployments typically need at least 2GB heap.
  • Check that all components start in the correct order: Dependencies are configured, but network issues can cause timeouts.
  • Ensure host volumes are writable: Containers run as user 1000, ensure volume paths have appropriate permissions.
Check logs for any component:
If you encounter startup issues, try purging and restarting:
If Elasticsearch health checks fail, verify the node has sufficient resources and the discovery type is set correctly for your deployment (single-node by default).