k8sConfigs/efk/fluentd-daemonset.yaml
2025-01-23 01:35:27 +08:00

57 lines
1.4 KiB
YAML

apiVersion: apps/v1
kind: DaemonSet
metadata:
name: fluentd
namespace: efk
labels:
k8s-app: fluentd-logging
version: v1
spec:
selector:
matchLabels:
k8s-app: fluentd-logging
version: v1
template:
metadata:
labels:
k8s-app: fluentd-logging
version: v1
spec:
tolerations:
- key: node-role.kubernetes.io/control-plane
effect: NoSchedule
- key: node-role.kubernetes.io/master
effect: NoSchedule
containers:
- name: fluentd
image: fluent/fluentd-kubernetes-daemonset:v1.17.1-debian-elasticsearch8-1.0
env:
- name: K8S_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: TZ
value: Asia/Shanghai # 设置时区为东八区
resources:
limits:
memory: 200Mi
requests:
cpu: 100m
memory: 200Mi
volumeMounts:
- name: fluentd-config-volume
mountPath: /fluentd/etc/fluent.conf
subPath: fluent.conf
- name: timezone
mountPath: /etc/localtime
readOnly: true
terminationGracePeriodSeconds: 30
volumes:
- name: fluentd-config-volume
configMap:
name: fluentd-config
- name: timezone
hostPath:
path: /usr/share/zoneinfo/Asia/Shanghai # 挂载东八区时区文件