Files
Work-configuration-file/OpenTelemetry/Collector/03-otel-collector-daemonset.yaml
2026-01-19 22:08:33 +08:00

57 lines
1.5 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 部署 DaemonSet节点级指标采集
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: otel-collector-daemonset
namespace: monitoring
labels:
app: otel-collector-daemonset
spec:
selector:
matchLabels:
app: otel-collector-daemonset
template:
metadata:
labels:
app: otel-collector-daemonset
spec:
serviceAccountName: otel-collector
hostNetwork: false # 无需主机网络
containers:
- name: otel-collector
image: otel/opentelemetry-collector-contrib:latest
args: ["--config=/etc/otel-collector/config.yaml"]
# 挂载宿主机目录(采集节点指标)
volumeMounts:
- name: otel-config
mountPath: /etc/otel-collector
- name: proc
mountPath: /proc
readOnly: true
- name: sys
mountPath: /sys
readOnly: true
- name: rootfs
mountPath: /rootfs
readOnly: true
# 资源限制(按需调整)
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 100m
memory: 256Mi
volumes:
- name: otel-config
configMap:
name: otel-collector-config
- name: proc
hostPath:
path: /proc
- name: sys
hostPath:
path: /sys
- name: rootfs
hostPath:
path: /