You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 1, 2020. It is now read-only.
This setup is similar to the [`Full Stack Example`](https://github.com/elastic/examples/tree/master/Miscellaneous/docker/full_stack_example), but adopted to be run on a Kubernetes cluster.
13
7
8
+
There is no access control for the Kibana web interface. If you want to run this in public you need to secure your setup. The provided manifests here are for demonstration purposes only.
14
9
15
10
16
11
# Local Setup
@@ -21,41 +16,35 @@ Feature comparison of the log shippers in this repo:
21
16
22
17
```bash
23
18
minikube start --memory 4096
24
-
# --vm-driver kvm
25
19
26
20
minikube dashboard
27
21
# maybe wait a bit and retry
28
22
kubectl get --all-namespaces services,pods
29
23
```
30
24
31
-
## Extra configuration for Filebeat
25
+
## Logging with Elasticsearch and fluentd
32
26
33
27
```bash
34
-
minikube ssh
35
-
36
-
sudo sh -c "sed -i 's/^ExecStart=\/usr\/bin\/docker daemon.*$/& --log-opt labels=io.kubernetes.container.hash,io.kubernetes.container.name,io.kubernetes.pod.name,io.kubernetes.pod.namespace,io.kubernetes.pod.uid/' /etc/systemd/system/docker.service"
## Logging with Elasticsearch and filebeat, fluentd or fluent-bit
34
+
For the index pattern in Kibana choose `fluentd-*`, then switch to the "Discover" view.
35
+
Every log line by containers running within the Kubernetes cluster is enhanced by meta data like `namespace_name`, `labels` and so on. This way it is easy to group and filter down on specific parts.
description = "The Elastic stack, also known as the ELK stack, has become a wide-spread tool for aggregating logs. This recipe helps you to set it up in Kubernetes."
4
-
date = "2016-11-21"
4
+
date = "2017-10-30"
5
5
type = "page"
6
6
weight = 50
7
7
tags = ["recipe"]
8
8
+++
9
9
10
10
# Logging with the Elastic Stack
11
11
12
-
The Elastic stack, most prominently know as the ELK stack, in this recipe is the combination of Filebeat, Elasticsearch, and Kibana. This stack helps you get all logs from your containers into a single searchable data store without having to worry about logs disappearing together with the containers. With Kibana you get a nice analytics and visualization platform on top.
12
+
The Elastic stack, most prominently know as the ELK stack, in this recipe is the combination of Fluentd, Elasticsearch, and Kibana. This stack helps you get all logs from your containers into a single searchable data store without having to worry about logs disappearing together with the containers. With Kibana you get a nice analytics and visualization platform on top.
13
13
14
14

15
15
@@ -27,22 +27,14 @@ kubectl apply \
27
27
Now we need to open up Kibana. As we have no authentication set up in this recipe (you can check out [Shield](https://www.elastic.co/products/x-pack/security) for that), we access Kibana through
28
28
29
29
```nohighlight
30
-
$ POD=$(kubectl get pods --namespace logging --selector component=kibana \
30
+
$ POD=$(kubectl get pods --selector component=kibana \
Now you can open up your browser at `http://localhost:5601/app/kibana/` and access the Kibana frontend.
37
37
38
-
Now set `filebeat-*` for `index pattern`.
39
-
40
-
Then, we can choose `json.time` for `time-field name` below.
38
+
Now set `fluentd-*` for `index pattern`.
41
39
42
40
All set! You can now use Kibana to access your logs including filtering logs based on pod names and namespaces.
43
-
44
-
## Configuring Curator to change log retention
45
-
46
-
Included in this recipe, there is a Scheduled Job running [Curator](https://github.com/elastic/curator) once a day to clean up your logs. The pod is set to run at 1 minute past midnight and delete indices that are older than 3 days.
47
-
48
-
You can change this by editing the ConfigMap named `curator-config`. The definition of the `action_file.yaml` is quite self-explaining for simple set ups. For more advanced configuration options, please consult the [Curator Documentation](https://www.elastic.co/guide/en/elasticsearch/client/curator/current/index.html).
0 commit comments