Skip to content

Commit

Permalink
collect service log
Browse files Browse the repository at this point in the history
Signed-off-by: wenchajun <[email protected]>
  • Loading branch information
wenchajun committed Sep 13, 2021
1 parent 8cb6c0c commit caf404f
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ helm install fluentbit-operator --create-namespace -n kubesphere-logging-system
If your container runtime is `cri-o`

```shell
helm install fluentbit-operator --create-namespace -n kubesphere-logging-system charts/fluentbit-operator/ --set containerRuntime=cri-o
helm install fluentbit-operator --create-namespace -n kubesphere-logging-system charts/fluentbit-operator/ --set containerRuntime=crio
```

### Quick Start
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
- /bin/sh
- '-c'
- set -ex;
echo CONTAINER_ROOT_DIR=$(docker info -f '{{`{{ .DockerRootDir }}`}}') > /fluentbit-operator/fluent-bit.env
echo CONTAINER_ROOT_DIR=$(docker info -f '{{`{{.DockerRootDir}}`}}') > /fluentbit-operator/fluent-bit.env
volumeMounts:
- name: env
mountPath: /fluentbit-operator
Expand All @@ -54,7 +54,7 @@ spec:
- /bin/sh
- '-c'
- set -ex;
echo CONTAINER_ROOT_DIR=$(crictl info --output go-template --template '{{`{{ .config.containerdRootDir }}`}}') > /fluentbit-operator/fluent-bit.env
echo CONTAINER_ROOT_DIR=$(crictl info --output go-template --template '{{`{{.config.containerdRootDir}}`}}') > /fluentbit-operator/fluent-bit.env
volumeMounts:
- name: env
mountPath: /fluentbit-operator
Expand All @@ -64,7 +64,7 @@ spec:
- name: crictl
readOnly: true
mountPath: /usr/local/bin/crictl
{{- else if eq .Values.containerRuntime "cri-o" }}
{{- else if eq .Values.containerRuntime "crio" }}
volumes:
- name: env
emptyDir: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
apiVersion: logging.kubesphere.io/v1alpha2
kind: Input
metadata:
name: docker
name: {{ .Values.containerRuntime }}
labels:
logging.kubesphere.io/enabled: "true"
logging.kubesphere.io/component: logging
spec:
systemd:
tag: service.docker
tag: service.{{ .Values.containerRuntime }}
path: /var/log/journal
db: /fluent-bit/tail/docker.db
dbSync: Normal
systemdFilter:
- _SYSTEMD_UNIT=docker.service
- _SYSTEMD_UNIT={{ .Values.containerRuntime }}.service
{{- end }}
2 changes: 1 addition & 1 deletion charts/fluentbit-operator/templates/input-tail.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
parser: docker
{{- else if eq .Values.containerRuntime "containerd" }}
parser: cri
{{- else if eq .Values.containerRuntime "cri-o" }}
{{- else if eq .Values.containerRuntime "crio" }}
parser: cri
{{- end }}
refreshIntervalSeconds: 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ spec:
es:
host: {{ .Values.output.es.host }}
port: {{ .Values.output.es.port }}
generateID: true
logstashPrefix: ks-logstash-log
logstashFormat: true
timeKey: "@timestamp"
Expand Down
2 changes: 1 addition & 1 deletion charts/fluentbit-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Kubernetes: false
input:
tail:
memBufLimit: 5MB
#Set this to containerd or cri-o if you want to collect CRI format logs
#Set this to containerd or crio if you want to collect CRI format logs
containerRuntime: docker
logPath:
crio: /var/log
Expand Down
1 change: 1 addition & 0 deletions manifests/logging-stack/output-elasticsearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ spec:
es:
host: elasticsearch-logging-data.kubesphere-logging-system.svc
port: 9200
generateID: true
logstashPrefix: ks-logstash-log
logstashFormat: true
timeKey: "@timestamp"

0 comments on commit caf404f

Please sign in to comment.