반응형
Fluent-Bit 을 k8s DaemonSet 으로 실행할 경우 서버 내의 journal 폴더가 /var/log/journal 로 되어있을 경우
마운트 설정이 필요없지만, 아닐 경우 DaemonSet 에 마운트해야한다.
journal이 위치한 경로를 찾아 설정한다.
DaemonSet 수정
kubectl edit ds -n fluent-bit -n fluent
...
spec:
containers:
- args:
-
...
command:
...
volumeMounts:
- mountPath: /run/log/journal ## 추가
name: systemd-log ## 추가
readOnly: true ## 추가
dnsPolicy:
restartPolicy:
...
toleration:
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
volumes:
- hostPath: ## 추가
path: /run/log/journal ## 추가
name: systemd-log ## 추가
수정 후 ConfigMap 수정
kubectl edit cm fluent-bit -n fluent
[INPUT]
Name systemd
Path /run/log/journal
Tag systemd.*
Systemd_Filter _SYSTEM_UNIT=kubelet.service
Systemd_Filter _SYSTEM_UNIT=containerd.service
Read_From_tail On
## 아래는 없어도 됨
[FILTER]
Name record_modifier
Match systemd.*
Record kubernetes systemd
반응형
'Develop > k8s' 카테고리의 다른 글
OpenSearch Operator Coordinator (0) | 2025.02.18 |
---|---|
k8s Audit Policy (k8s 감사 정책) (0) | 2024.12.21 |
k8s ServiceAccount Token Refresh (0) | 2024.12.17 |
opensearch operator read only mode (0) | 2024.12.02 |
인증서 방식 계정 생성 (Certificates and Certificate Signing Requests) (0) | 2024.11.29 |