From d6c56d42767908c4756f47b02426803ddb156a79 Mon Sep 17 00:00:00 2001 From: Benjamin Huo Date: Tue, 17 May 2022 15:50:30 +0800 Subject: [PATCH] Move some content to fluent operator walkthrough Signed-off-by: Benjamin Huo --- README.md | 646 +----------------------------------------------------- 1 file changed, 4 insertions(+), 642 deletions(-) diff --git a/README.md b/README.md index 0a1997d3b..0b0bdc410 100644 --- a/README.md +++ b/README.md @@ -176,77 +176,9 @@ helm install fluent-operator --create-namespace -n fluent https://github.com/flu > Please replace < version > with a actual version like v1.0.0 -### Quick Start - -##### Fluent Bit quick start - -The quick start instructs you to deploy fluent bit with `dummy` as input and `stdout` as output, which is equivalent to execute the binary with `fluent-bit -i dummy -o stdout`. - -```shell -kubectl apply -f https://raw.githubusercontent.com/fluent/fluent-operator/master/manifests/quick-start/fluentbit.yaml -``` - -Once everything is up, you'll observe messages in fluent bit pod logs like below: - -```shell -[0] my_dummy: [1587991566.000091658, {"message"=>"dummy"}] -[1] my_dummy: [1587991567.000061572, {"message"=>"dummy"}] -[2] my_dummy: [1587991568.000056842, {"message"=>"dummy"}] -[3] my_dummy: [1587991569.000896217, {"message"=>"dummy"}] -[0] my_dummy: [1587991570.000172328, {"message"=>"dummy"}] -``` - -It means the FluentBit Operator works properly if you see the above messages, you can delete the quick start test by - -```shell -kubectl delete -f https://raw.githubusercontent.com/kubesphere/fluentbit-operator/master/manifests/quick-start/quick-start.yaml -``` - -##### Fluentd quick start - -Fluentd in Fluent Operator is used to receive logs from Fluent Bit or other sources like HTTP and Syslog, etc. - -``` -kubectl apply -f manifests/quick-start/fluentd-forward.yaml -``` - -##### Configure Custom Watch Namespaces - -It is recommended to use the CRDs like FluentdConfig or ClusterFluentdConfig to watch namespaces. - -Cluster-level ClusterFluentdConfig defined like follows: - -``` -apiVersion: fluentd.fluent.io/v1alpha1 -kind: ClusterFluentdConfig -metadata: - name: fluentd-config - labels: - config.fluentd.fluent.io/enabled: "true" -spec: - watchedNamespaces: - - kube-system - - default - clusterOutputSelector: - matchLabels: - output.fluentd.fluent.io/enabled: "true" -``` - -Namespace-level FluentdConfig will collect the logs from its namespace field. - -``` -apiVersion: fluentd.fluent.io/v1alpha1 -kind: FluentdConfig -metadata: - name: fluentd-config - namespace: fluent - labels: - config.fluentd.fluent.io/enabled: "true" -spec: - clusterOutputSelector: - matchLabels: - output.fluentd.fluent.io/enabled: "true" -``` +### Fluent Operator Walkthrough + +For more info on various use cases of Fluent Operator, you can refer to [Fluent-Operator-Walkthrough](https://github.com/kubesphere-sigs/fluent-operator-walkthrough). ### Fluent Bit: Collect Kubernetes logs @@ -338,577 +270,7 @@ green open ks-logstash-log-2021.04.06 QeI-k_LoQZ2h1z23F3XiHg 5 1 404879 0 298.4 Fluentd acts as a log forward layer that receives logs from Fluent Bit or other Apps through the network. -#### Collecting logs from Fluent Bit - -##### Enable Fluent Bit forward plugin - -At first, you should enable the forward plugin in Fluent Bit to send logs to Fluentd. - -```shell -cat <