Kubernetes ELK demonstration
This repository contains files to demonstrate a simple ELK setup on Kubernetes.
Launching on Kubernetes
To launch the ELK stack:
- Ensure
kubectl
is configured to use an appropriate Kubernetes cluster. - Launch the ELK ReplicationController:
kubectl create -f elk-rc.yaml
- Launch the internal Logstash Service:
kubectl create -f elk-svc-logstash.yaml
- Launch the public Kibana Service:
kubectl create -f elk-svc-kibana.yaml
- Watch
kubectl get pods
andkubectl get svc
until the services are up and the public IP becomes available.
To launch the demo application:
- Launch the demo-app ReplicationController:
kubectl create -f demo-rc.yaml
- Launch the demo-app public Service:
kubectl create -f demo-svc.yaml
- Watch
kubectl get svc
until the service becomes available, then point your web browser at it. Logs from this service are sent to Logstash configured above.
To demonstrate rolling-updates:
- Open the
demo-rc.yaml
file. - Change all instances of
demo-app-v1
todemo-app-v2
- Change the git-repository revision in volumes from
static-v1
tostatic-v2
- Start the rolling update:
kubectl rolling-update demo-app-v1 demo-app-v2 -f demo-rc.yaml
Docker images
There are a few simple Docker images needed for the presentation.
docker/elasticsearch
This image is based of Docker's official elasticsearch
image with small
configuration changes to listen on external network interfaces.
docker/logstash
This image is based of Docker's official logstash
image and installs the
log-courier plugin. Configuration is added to use the plugin and to grok
nginx logs.
docker/log-courier
This image is the log-courier client configured to forward logs to the internal Logstash service. See the configuration file for this service as an example of KubeDNS usage.
docker/nginx
This image is the nginx web server configured to serve static files from the volume mounted into the container in the demo-service.