113 lines
2.7 KiB
YAML
113 lines
2.7 KiB
YAML
|
|
apiVersion: v1
|
||
|
|
kind: ServiceAccount
|
||
|
|
metadata:
|
||
|
|
name: node-exporter
|
||
|
|
namespace: monitoring
|
||
|
|
---
|
||
|
|
apiVersion: v1
|
||
|
|
kind: Service
|
||
|
|
metadata:
|
||
|
|
name: node-exporter
|
||
|
|
namespace: monitoring
|
||
|
|
labels:
|
||
|
|
app: node-exporter
|
||
|
|
annotations:
|
||
|
|
prometheus.io/scrape: "true"
|
||
|
|
prometheus.io/port: "9100"
|
||
|
|
spec:
|
||
|
|
selector:
|
||
|
|
app: node-exporter
|
||
|
|
ports:
|
||
|
|
- name: metrics
|
||
|
|
port: 9100
|
||
|
|
targetPort: 9100
|
||
|
|
---
|
||
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
||
|
|
kind: ClusterRole
|
||
|
|
metadata:
|
||
|
|
name: node-exporter
|
||
|
|
rules:
|
||
|
|
- apiGroups: [""]
|
||
|
|
resources: ["nodes"]
|
||
|
|
verbs: ["get", "list", "watch"]
|
||
|
|
---
|
||
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
||
|
|
kind: ClusterRoleBinding
|
||
|
|
metadata:
|
||
|
|
name: node-exporter
|
||
|
|
roleRef:
|
||
|
|
apiGroup: rbac.authorization.k8s.io
|
||
|
|
kind: ClusterRole
|
||
|
|
name: node-exporter
|
||
|
|
subjects:
|
||
|
|
- kind: ServiceAccount
|
||
|
|
name: node-exporter
|
||
|
|
namespace: monitoring
|
||
|
|
---
|
||
|
|
apiVersion: apps/v1
|
||
|
|
kind: DaemonSet
|
||
|
|
metadata:
|
||
|
|
name: node-exporter
|
||
|
|
namespace: monitoring
|
||
|
|
labels:
|
||
|
|
app: node-exporter
|
||
|
|
spec:
|
||
|
|
selector:
|
||
|
|
matchLabels:
|
||
|
|
app: node-exporter
|
||
|
|
template:
|
||
|
|
metadata:
|
||
|
|
labels:
|
||
|
|
app: node-exporter
|
||
|
|
spec:
|
||
|
|
serviceAccountName: node-exporter
|
||
|
|
hostPID: true
|
||
|
|
hostNetwork: true
|
||
|
|
tolerations:
|
||
|
|
- key: node-role.kubernetes.io/control-plane
|
||
|
|
operator: Exists
|
||
|
|
effect: NoSchedule
|
||
|
|
- key: node-role.kubernetes.io/master
|
||
|
|
operator: Exists
|
||
|
|
effect: NoSchedule
|
||
|
|
containers:
|
||
|
|
- name: node-exporter
|
||
|
|
image: prom/node-exporter:v1.7.0
|
||
|
|
args:
|
||
|
|
- --path.procfs=/host/proc
|
||
|
|
- --path.sysfs=/host/sys
|
||
|
|
- --path.rootfs=/host/root
|
||
|
|
- --collector.filesystem.mount-points-exclude=^/(dev|proc|sys|var/lib/docker/.+)($|/)
|
||
|
|
- --collector.filesystem.fs-types-exclude=^(autofs|binfmt_misc|cgroup|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|mqueue|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|sysfs|tracefs)$
|
||
|
|
ports:
|
||
|
|
- containerPort: 9100
|
||
|
|
hostPort: 9100
|
||
|
|
name: metrics
|
||
|
|
volumeMounts:
|
||
|
|
- name: proc
|
||
|
|
mountPath: /host/proc
|
||
|
|
readOnly: true
|
||
|
|
- name: sys
|
||
|
|
mountPath: /host/sys
|
||
|
|
readOnly: true
|
||
|
|
- name: root
|
||
|
|
mountPath: /host/root
|
||
|
|
readOnly: true
|
||
|
|
resources:
|
||
|
|
requests:
|
||
|
|
memory: "64Mi"
|
||
|
|
cpu: "50m"
|
||
|
|
limits:
|
||
|
|
memory: "128Mi"
|
||
|
|
cpu: "200m"
|
||
|
|
volumes:
|
||
|
|
- name: proc
|
||
|
|
hostPath:
|
||
|
|
path: /proc
|
||
|
|
- name: sys
|
||
|
|
hostPath:
|
||
|
|
path: /sys
|
||
|
|
- name: root
|
||
|
|
hostPath:
|
||
|
|
path: /
|