update setting-up-a-logging-plugin.md (#688)

This commit is contained in:
Yanwei Guo 2019-01-23 10:16:35 -08:00 committed by Knative Prow Robot
parent 49494addfa
commit 43bea1b3d5
1 changed files with 11 additions and 16 deletions

View File

@ -23,15 +23,15 @@ Operators can do the following steps to configure the Fluentd DaemonSet for
collecting `stdout/stderr` logs from the containers: collecting `stdout/stderr` logs from the containers:
1. Replace `900.output.conf` part in 1. Replace `900.output.conf` part in
[100-fluentd-configmap.yaml](https://https://github.com/knative/serving/blob/master/config/monitoring/150-elasticsearch/100-fluentd-configmap.yaml) [100-fluentd-configmap.yaml](https://github.com/knative/serving/blob/master/config/monitoring/logging/elasticsearch/100-fluentd-configmap.yaml)
with the desired output configuration. Knative provides a sample for sending with the desired output configuration. Knative provides a sample for sending
logs to Elasticsearch or Stackdriver. Developers can simply use logs to Elasticsearch or Stackdriver. Developers can simply use
`100-fluentd-configmap.yaml` or override any with other configuration. `100-fluentd-configmap.yaml` or override any with other configuration.
2. Replace the `image` field of `fluentd-ds` container in 2. Replace the `image` field of `fluentd-ds` container of `flunetd-ds` DaemonSet
[fluentd-ds.yaml](https://github.com/knative/serving/blob/master/third_party/config/monitoring/common/kubernetes/fluentd/fluentd-ds.yaml) in
[200-fluentd.yaml](https://github.com/knative/serving/blob/master/config/monitoring/logging/elasticsearch/200-fluentd.yaml)
with the Fluentd image including the desired Fluentd output plugin. See with the Fluentd image including the desired Fluentd output plugin. See
[here](image/fluentd/README.md) for the requirements of Flunetd image on [here](fluentd/README.md) for the requirements of Flunetd image on Knative.
Knative.
### Configure the Sidecar for log files under /var/log ### Configure the Sidecar for log files under /var/log
@ -46,7 +46,7 @@ of the sidecar. The steps to configure are:
`monitoring` namespace while the Fluentd sidecar is in the namespace same `monitoring` namespace while the Fluentd sidecar is in the namespace same
with the app. There may be small differences between the configuration for with the app. There may be small differences between the configuration for
DaemonSet and sidecar even though the desired backends are the same. DaemonSet and sidecar even though the desired backends are the same.
1. Replace `logging.fluentd-sidecar-image` flag in 2. Replace `logging.fluentd-sidecar-image` flag in
[config-observability](https://github.com/knative/serving/blob/master/config/config-observability.yaml) [config-observability](https://github.com/knative/serving/blob/master/config/config-observability.yaml)
with the Fluentd image including the desired Fluentd output plugin. In with the Fluentd image including the desired Fluentd output plugin. In
theory, this is the same with the one for Fluentd DaemonSet. theory, this is the same with the one for Fluentd DaemonSet.
@ -60,14 +60,12 @@ Operators need to deploy Knative components after the configuring:
kubectl apply --filename config/config-observability.yaml kubectl apply --filename config/config-observability.yaml
# Deploy the DaemonSet to make configuration for DaemonSet take effect # Deploy the DaemonSet to make configuration for DaemonSet take effect
kubectl apply --filename <the-fluentd-config-for-daemonset> \ kubectl apply --recursive --filename config/monitoring/100-namespace.yaml \
--filename third_party/config/monitoring/common/kubernetes/fluentd/fluentd-ds.yaml \ --filename <path-of-fluentd-daemonset-config>
--filename config/monitoring/200-common/100-fluentd.yaml
--filename config/monitoring/200-common/100-istio.yaml
``` ```
In the commands above, replace `<the-fluentd-config-for-daemonset>` with the In the commands above, replace `<path-of-fluentd-daemonset-config>` with the
Fluentd DaemonSet configuration file, e.g. `config/monitoring/150-stackdriver`. Fluentd DaemonSet configuration file, e.g. `config/monitoring/stackdriver`.
**NOTE**: The deployment above will not affect the fluentd sidecar of existing **NOTE**: The deployment above will not affect the fluentd sidecar of existing
pods. Developers need to redeploy their app to get the newest configuration for pods. Developers need to redeploy their app to get the newest configuration for
@ -89,10 +87,7 @@ whole Knative monitoring components.
To uninstall a logging plugin, run: To uninstall a logging plugin, run:
```shell ```shell
kubectl delete --filename <the-fluentd-config-for-daemonset> \ kubectl delete --recursive --filename <path-of-fluentd-daemonset-config>
-f third_party/config/monitoring/common/kubernetes/fluentd/fluentd-ds.yaml \
-f config/monitoring/200-common/100-fluentd.yaml
-f config/monitoring/200-common/100-istio.yaml
``` ```
--- ---