Some checks failed
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 2m37s
CD Pipeline / post-deploy-checks (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled
115 lines
2.6 KiB
YAML
115 lines
2.6 KiB
YAML
# Node Problem Detector 完整部署
|
|
# 建立者: Claude Code (首席架構師)
|
|
# 日期: 2026-03-28 (台北)
|
|
# 用途: 偵測節點問題 (OOM, 磁碟壓力, 內核問題等)
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Namespace
|
|
metadata:
|
|
name: node-problem-detector
|
|
labels:
|
|
app: node-problem-detector
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: ServiceAccount
|
|
metadata:
|
|
name: node-problem-detector
|
|
namespace: node-problem-detector
|
|
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: ClusterRole
|
|
metadata:
|
|
name: node-problem-detector
|
|
rules:
|
|
- apiGroups: [""]
|
|
resources: ["nodes"]
|
|
verbs: ["get"]
|
|
- apiGroups: [""]
|
|
resources: ["nodes/status"]
|
|
verbs: ["patch"]
|
|
- apiGroups: [""]
|
|
resources: ["events"]
|
|
verbs: ["create", "patch", "update"]
|
|
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: ClusterRoleBinding
|
|
metadata:
|
|
name: node-problem-detector
|
|
roleRef:
|
|
apiGroup: rbac.authorization.k8s.io
|
|
kind: ClusterRole
|
|
name: node-problem-detector
|
|
subjects:
|
|
- kind: ServiceAccount
|
|
name: node-problem-detector
|
|
namespace: node-problem-detector
|
|
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: DaemonSet
|
|
metadata:
|
|
name: node-problem-detector
|
|
namespace: node-problem-detector
|
|
labels:
|
|
app: node-problem-detector
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app: node-problem-detector
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: node-problem-detector
|
|
spec:
|
|
serviceAccountName: node-problem-detector
|
|
containers:
|
|
- name: node-problem-detector
|
|
image: 192.168.0.110:5000/awoooi/runtime-mirror/node-problem-detector@sha256:2be81bb099408c5b5fc2e82d411c6deb3ffe3a7bb7ba21ac0f0afc3435938304
|
|
command:
|
|
- /node-problem-detector
|
|
- --logtostderr
|
|
- --config.system-log-monitor=/config/kernel-monitor.json,/config/docker-monitor.json
|
|
resources:
|
|
limits:
|
|
cpu: 100m
|
|
memory: 100Mi
|
|
requests:
|
|
cpu: 20m
|
|
memory: 50Mi
|
|
securityContext:
|
|
privileged: true
|
|
env:
|
|
- name: NODE_NAME
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: spec.nodeName
|
|
volumeMounts:
|
|
- name: log
|
|
mountPath: /var/log
|
|
readOnly: true
|
|
- name: kmsg
|
|
mountPath: /dev/kmsg
|
|
readOnly: true
|
|
- name: localtime
|
|
mountPath: /etc/localtime
|
|
readOnly: true
|
|
tolerations:
|
|
- operator: Exists
|
|
effect: NoSchedule
|
|
- operator: Exists
|
|
effect: NoExecute
|
|
volumes:
|
|
- name: log
|
|
hostPath:
|
|
path: /var/log/
|
|
- name: kmsg
|
|
hostPath:
|
|
path: /dev/kmsg
|
|
- name: localtime
|
|
hostPath:
|
|
path: /etc/localtime
|