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
Copy file name to clipboardExpand all lines: src/managing-workflow/platform-logging.md
+47-56Lines changed: 47 additions & 56 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,44 +2,16 @@
2
2
3
3
The logging platform is made up of 2 components - [Fluentd](https://github.com/deis/fluentd) and [Logger](https://github.com/deis/logger).
4
4
5
-
[Fluentd](https://github.com/deis/fluentd) runs on every worker node of the cluster and is deployed as a [Daemon Set](http://kubernetes.io/v1.1/docs/admin/daemons.html). The Fluentd pods capture all of the stderr and stdout streams of every container running on the host (even those not hosted directly by kubernetes). It then sends this data via the Syslog UDP port (514) to the Logger component.
5
+
[Fluentd](https://github.com/deis/fluentd) runs on every worker node of the cluster and is deployed as a [Daemon Set](http://kubernetes.io/v1.1/docs/admin/daemons.html). The Fluentd pods capture all of the stderr and stdout streams of every container running on the host (even those not hosted directly by kubernetes). Once the log message arrives in our [custom fluentd plugin](https://github.com/deis/fluentd/tree/master/rootfs/opt/fluentd/deis-output) we determine where the message originated.
6
6
7
-
Logger acts like a syslog server and receives all log messages that are occurring on the cluster. It then filters this data to only Deis deploy applications and stores those log messages in a ring buffer where they can be fetched via the Deis CLI.
7
+
If the message was from the [Workflow Controller](https://github.com/deis/controller) or from an application deployed via workflow we send it to the logs topic on the local [NSQD](nsq.io) instance.
8
8
9
-
## Installation
9
+
If the message is from the [Workflow Router](https://github.com/deis/router) we build an Influxdb compatible message and send it to the same NSQD instance but instead place the message on the metrics topic.
10
10
11
-
The logging system is part of the main installation of Workflow. You will need to watch the components come up and verify they are in a running state by executing the following command:
11
+
Logger then acts as a consumer reading messages off of the NSQ logs topic storing those messages in a local Redis instance. When a user wants to retrieve log entries using the `deis logs` command we make an HTTP request from Controller to Logger which then fetches the appropriate data from Redis.
12
12
13
-
```
14
-
$ kubectl --namespace=deis get pods
15
-
```
16
-
17
-
You should see output similar to this:
18
-
```
19
-
NAME READY STATUS RESTARTS AGE
20
-
deis-builder-2qgil 1/1 Running 2 17h
21
-
deis-controller-6rivh 1/1 Running 3 17h
22
-
deis-database-iou5f 1/1 Running 0 17h
23
-
deis-logger-6er1f 1/1 Running 0 1h
24
-
deis-logger-fluentd-4asyw 1/1 Running 0 1h
25
-
deis-logger-fluentd-tbhvf 1/1 Running 0 1h
26
-
deis-minio-2jnr7 1/1 Running 0 17h
27
-
deis-registry-terrk 1/1 Running 4 17h
28
-
deis-router-jakw6 1/1 Running 0 17h
29
-
deis-workflow-manager-f1ige 1/1 Running 0 33m
30
-
```
31
-
32
-
There should be a fluentd pod per worker node of your Kubernetes cluster. So if you are running a 3 node cluster with 1 master and 2 workers you will have 2 fluentd pods running.
33
-
34
-
Once you have verified that the pods have started correctly you will need to restart your controller pod so that it can capture the correct information about how to talk to the logger pod.
The replication controller will restart a new pod with all of the correct information.
41
-
42
-
Once the pod has restarted, you can verify the logging system is working by going to a deployed app and executing the `deis logs` command. If an error occurs the CLI will print a user friendly message about how to debug the issue.
13
+
## Debugging Logger
14
+
If the `deis logs` command encounters an error it will return the following message:
43
15
44
16
```
45
17
Error: There are currently no log messages. Please check the following things:
@@ -50,38 +22,45 @@ Error: There are currently no log messages. Please check the following things:
By default the Fluentd pod can be configured to talk to numerous syslog endpoints. So for example it is possible to have Fluentd send log messages to both the Logger component and [Papertrail](https://papertrailapp.com/). This allows production deployments of Deis to satisfy stringent logging requirements such as offsite backups of log data.
73
56
74
-
Configuring Fluentd to talk to multiple syslog endpoints means adding the following stanzas to the Fluentd daemonset manifest -
57
+
Configuring Fluentd to talk to multiple syslog endpoints means adding the following stanzas to the [Fluentd daemonset manifest](https://github.com/deis/charts/blob/master/workflow-v2.1.0/tpl/deis-logger-fluentd-daemon.yaml) -
75
58
76
59
```
77
60
env:
78
61
- name: "SYSLOG_HOST_1"
79
-
value: $(DEIS_LOGGER_SERVICE_HOST)
62
+
value: "my.syslog.host"
80
63
- name: "SYSLOG_PORT_1"
81
-
value: $(DEIS_LOGGER_SERVICE_PORT_TRANSPORT)
82
-
- name: "SYSLOG_HOST_2"
83
-
value: "my.syslog.host.2"
84
-
- name: "SYSLOG_PORT_2"
85
64
value: "5144"
86
65
....
87
66
- name: "SYSLOG_HOST_N"
@@ -90,3 +69,15 @@ env:
90
69
value: "51333"
91
70
```
92
71
72
+
If you only need to talk to 1 Syslog endpoint you can use the following configuration within your chart:
73
+
74
+
```
75
+
env:
76
+
- name: "SYSLOG_HOST"
77
+
value: "my.syslog.host"
78
+
- name: "SYSLOG_PORT"
79
+
value: "5144"
80
+
```
81
+
82
+
### Customizing:
83
+
We currently support logging information to Syslog, Elastic Search, and Sumo Logic. However, we will gladly accept pull requests that add support to other locations. For more information please visit the [fluentd repository](https://github.com/deis/fluentd).
With the release of Deis Workflow, we now include a monitoring stack for introspection on a running Kubernetes cluster. The stack includes 4 components:
6
-
4
+
We now include a monitoring stack for introspection on a running Kubernetes cluster. The stack includes 3 components:
7
5
*[Telegraf](https://docs.influxdata.com/telegraf/v0.12/) - Metrics collection daemon written by team behind InfluxDB.
8
6
*[InfluxDB](https://docs.influxdata.com/influxdb/v0.12/) - Time series database
9
7
*[Grafana](http://grafana.org/) - Graphing tool for time series data
10
-
*[Stdout-Metrics](https://github.com/deis/stdout-metrics) - Tool for consuming metrics via standard out and forwards them to InfluxDB
@@ -53,7 +55,7 @@ them separately in version control.
53
55
54
56
### InfluxDB
55
57
56
-
As of the Beta4 release InfluxDB is writing data to the host disk, however, if the InfluxDB pod dies and comes back on
58
+
InfluxDB writes data to the host disk, however, if the InfluxDB pod dies and comes back on
57
59
another host the data will not be recovered. We intend to fix this in a future release. The InfluxDB Admin UI is also
58
60
exposed through the router allowing users to access the query engine by going to `influx.mydomain.com`. You will need to
59
61
configure where to find the `influx-api` endpoint by clicking the "gear" icon at the top right and changing the host to
@@ -76,13 +78,8 @@ Telegraf is the metrics collection daemon used within the monitoring stack. It w
76
78
77
79
It is possible to send these metrics to other endpoints besides InfluxDB. For more information please consult the following [file](https://github.com/deis/monitor/blob/master/telegraf/rootfs/config.toml.tpl)
78
80
79
-
### Stdout-Metrics
80
-
81
-
Stdout-Metrics is a custom tool built by the Deis team to provide metrics that are reported via standard out - like Nginx. It consumes the log stream from FluentD filtering out messages that are not from the [Deis Router](https://github.com/deis/router). Once it finds a message it can parse it will turn that into a metric and send it directly to InfluxDB.
82
-
83
81
### Customizing
84
82
85
83
Each of these components allows for customization via environment variables. If you would like to learn more please visit the following github repositories:
0 commit comments