KubeKanvas Logo
  • Features
  • Pricing
  • Templates
    • How KubeKanvas works
    • Docs
    • Downloads
    • Blog
    • E-Book
    • Tutorials
  • FAQs
  • Contact
  • Features
  • Pricing
  • Templates
    • How KubeKanvas works
    • Docs
    • Downloads
    • Blog
    • E-Book
    • Tutorials
  • FAQs
  • Contact
Back to Templates

ELK Stack on Kubernetes: Nginx Log Collection and Visualization

Tags:
ElasticsearchKubernetesLog MonitoringFilebeatLogstashKibana
Created by:
Mahmood
ELK Stack on Kubernetes: Nginx Log Collection and Visualization template preview
3 uses
KubeKanvas Logo
Visual Kubernetes cluster design tool that helps you create, manage, and deploy your applications with ease.
Product
  • Features
  • Pricing
  • Templates
Resources
  • Blog
  • Tutorials
Company
  • About Us
  • Contact
  • Terms of Service
  • Privacy Policy
  • Impressum
XGitHubLinkedIn
© 2026 KubeKanvas. All rights reserved.

Collecting, parsing, storing, and visualizing application logs on Kubernetes requires wiring together multiple components in a specific sequence. This template deploys a complete ELK stack on Kubernetes for Nginx log monitoring, including Filebeat for log collection, Logstash for parsing, Elasticsearch for storage, and Kibana for visualization, all preconfigured as a working pipeline on Docker Desktop Kubernetes.

What's Included

ComponentTypePortRole
NginxDeployment + Service80Application server generating logs at /var/log/nginx
FilebeatDeployment-Log collection agent that forwards entries to Logstash
LogstashDeployment + Service5044Log parsing and transformation pipeline
ElasticsearchStatefulSet + Service9200Log storage and search backend
KibanaDeployment + Service5601Log visualization and query interface
IngressIngress80Routes external traffic to Nginx and Kibana at http://elk.local/

Architecture Overview

Nginx generates access and error logs at /var/log/nginx. Filebeat tails those log files and ships entries to Logstash over port 5044. Logstash parses and transforms the raw log data before forwarding it to Elasticsearch, which indexes and stores the logs for search. Kibana connects to Elasticsearch on port 9200 and provides a UI for querying and visualizing the indexed data. An Ingress exposes both Nginx and Kibana externally at http://elk.local/.

Prerequisites

  • Docker Desktop with Kubernetes enabled
  • NGINX Ingress Controller installed
  • elk.local added to your /etc/hosts file pointing at 127.0.0.1
  • KubeKanvas CLI installed and running on your computer (Optional, if you want to use one-click deployment)

How to Deploy

  1. Click on the button at the top right corner of this page to load the manifest into the editor.
  2. Add 127.0.0.1 elk.local to your /etc/hosts file before deploying.
  3. Review the Filebeat configuration to confirm the log path matches the Nginx log volume mount.
  4. Deploy the template to your cluster via the Play button in the top right bar. If you prefer to deploy manually, download the YAML and apply it with kubectl.
  5. Wait for all pods to reach Running status. You can monitor progress in the Release Monitor screen.

How to Test

  1. Confirm all five pods are running: kubectl get pods -n <namespace> — Nginx, Filebeat, Logstash, Elasticsearch, and Kibana should all show Running.
  2. Open http://elk.local/ in your browser and confirm the Nginx default page loads, generating log entries.
  3. Access Kibana at http://elk.local/ or via port-forward: kubectl port-forward svc/kibana 5601:5601 -n <namespace>, then open it at http://localhost:5601.
  4. In Kibana, go to Discover and create an index pattern for Elasticsearch. Confirm Nginx log entries are appearing.
  5. If no logs appear in Kibana, check Filebeat for connectivity errors: kubectl logs <filebeat-pod> -n <namespace>.

Use Cases

  • Nginx log monitoring on Kubernetes: Collecting and visualizing Nginx access and error logs from a pod without external log infrastructure.
  • ELK stack local development: Running the full Filebeat, Logstash, Elasticsearch, and Kibana pipeline on Docker Desktop for learning and prototyping.
  • Log pipeline validation: Testing a Filebeat to Logstash to Elasticsearch pipeline locally before deploying it to a staging or production cluster.
  • Structured log search: Indexing parsed Nginx logs in Elasticsearch and querying them in Kibana using KQL or Lucene syntax.

Summary

This template configures a complete ELK stack on Kubernetes for Nginx log collection, parsing, storage, and visualization using Filebeat, Logstash, Elasticsearch, and Kibana.