【问题标题】:cAdvisor : Could not configure a source for OOM detectioncAdvisor:无法配置 OOM 检测源
【发布时间】:2022-07-15 20:22:34
【问题描述】:

我已经在 Kubernetes (EKS) 上部署了 cAdvisor DaemonSet,并带有以下清单

---

apiVersion: v1
kind: ServiceAccount
metadata:
  name: cadvisor
  namespace: kube-monitoring

---

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: cadvisor
rules:
  - apiGroups: ['policy']
    resources: ['podsecuritypolicies']
    verbs:     ['use']
    resourceNames:
    - cadvisor

---

kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: cadvisor
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cadvisor
subjects:
- kind: ServiceAccount
  name: cadvisor
  namespace: kube-monitoring

---

apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: cadvisor
  namespace: kube-monitoring
spec:
  selector:
    matchLabels:
      name: cadvisor
  template:
    metadata:
      labels:
        name: cadvisor
    spec:
      serviceAccountName: cadvisor
      containers:
      - name: cadvisor
        image: google/cadvisor:latest
        resources:
          requests:
            memory: 400Mi
            cpu: 400m
          limits:
            memory: 2000Mi
            cpu: 800m
        ports:
          - name: http
            containerPort: 8080
            protocol: TCP
        volumeMounts:
        - name: rootfs
          mountPath: /rootfs
          readOnly: true
        - name: var-run
          mountPath: /var/run
          readOnly: true
        - name: sys
          mountPath: /sys
          readOnly: true
        - name: docker
          mountPath: /var/lib/docker
          readOnly: true
        - name: disk
          mountPath: /dev/disk
          readOnly: true
      automountServiceAccountToken: false
      terminationGracePeriodSeconds: 30
      volumes:
      - name: rootfs
        hostPath:
          path: /
      - name: var-run
        hostPath:
          path: /var/run
      - name: sys
        hostPath:
          path: /sys
      - name: docker
        hostPath:
          path: /var/lib/docker
      - name: disk
        hostPath:
          path: /dev/disk

---

但在 cAdvisor 容器日志中,我看到以下消息

W0608 16:00:47.238042       1 manager.go:349] Could not configure a source for OOM detection, disabling OOM events: open /dev/kmsg: no such file or directory

我可以毫无问题地通过http://localhost:8080/containers/ 连接到 cAdvisor UI。

这个 cAdvisor 设置有什么问题?

【问题讨论】:

  • 这里有同样的问题。 v0.36

标签: linux kubernetes prometheus amazon-eks cadvisor


【解决方案1】:

我认为问题已在此处找到并修复:https://github.com/google/cadvisor/issues/2150

【讨论】:

  • 虽然理论上可以回答这个问题,it would be preferable 在这里包含答案的基本部分,并提供链接以供参考。请edit回答所有相关信息。
猜你喜欢
  • 1970-01-01
  • 2021-05-17
  • 2017-05-02
  • 1970-01-01
  • 1970-01-01
  • 2020-03-04
  • 2012-10-21
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多