Fluentd
설치
helm repo add fluent https://fluent.github.io/helm-charts
helm repo update fluent \
&& helm search repo fluent/fluentd -l | head -n 10
helm show values fluent/fluentd \
--version 0.3.9 \
> fluentd-values.yaml
fluentd-values.yaml
kind: "DaemonSet" # DaemonSet, Deployment or StatefulSet
livenessProbe:
httpGet:
path: /metrics
port: metrics
initialDelaySeconds: 30
timeoutSeconds: 15
readinessProbe:
httpGet:
path: /metrics
port: metrics
initialDelaySeconds: 30
timeoutSeconds: 15
resources:
requests:
cpu: 100m
memory: 512Mi
limits:
memory: 512Mi
podLabels: {}
env:
- # /fluentd/etc/../../etc/fluent/fluent.conf
# /etc/fluent/fluent.conf
name: "FLUENTD_CONF"
value: "../../etc/fluent/fluent.conf"
dashboards:
enabled: "false"
plugins: []
configMapConfigs: []
fileConfigs:
01_sources.conf: |
02_filters.conf: |
03_dispatch.conf: |
04_outputs.conf: |
helm upgrade fluentd fluent/fluentd \
--install \
--version 0.3.9 \
-n monitoring \
--history-max 5 \
-f fluentd-values.yaml
설정
Input -> filter 1 -> ... -> filter N -> Output
<source>
: 어떤 정보를 입력받을지 설정@type
이 필수 입니다.
<filter <tag pattern>>
: 발생한 이벤트를 어떻게 처리할지 설정<match <tag pattern>>
: 처리된 값을 어떻게 사용할지 설정<system>
: 시스템 설정<label>
: 내부 라우팅을 위해 필터와 출력 그룹 설정@include path|glob|url
: 다른 설정파일 호출
경고
filter와 match는 선언 순서가 중요합니다. match 지시문의 패턴에 걸린 경우 그 다음 선언된 지시문은 실행되지 않습니다.
Tag pattern
- tag는
.
으로 구분 됩니다. *
: 태그 한 파트에 대한 glob입니다.a.*
는a.b
,a.c
와 매치되지만a
,a.b.c