From 85df3ea878b36770c4a6f367b688b3c6326d2046 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Mon, 10 Mar 2025 13:01:34 +0800 Subject: [PATCH] fluentd-daemon use customized fluend image --- efk/fluentd-daemonset.yaml | 125 ++++++++++++++++--------------------- 1 file changed, 53 insertions(+), 72 deletions(-) diff --git a/efk/fluentd-daemonset.yaml b/efk/fluentd-daemonset.yaml index 29fe822..06430c8 100644 --- a/efk/fluentd-daemonset.yaml +++ b/efk/fluentd-daemonset.yaml @@ -1,75 +1,56 @@ -apiVersion: v1 -kind: ConfigMap +apiVersion: apps/v1 +kind: DaemonSet metadata: - name: fluentd-config + name: fluentd namespace: efk -data: - fluent.conf: | - - @type http - @id input_http - port 8888 - tag sardine.log # 初始 tag,客户端需指定完整 tag 如 sardine.log.candle.BTC-USDT.15M - @label @main - - @type json - - + 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: localhost:32000/efk/fluentd-k8s-daemon-withrewrite + 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 # 挂载东八区时区文件 - - - - @type stdout - @id output_stdout_all -