当前位置:   article > 正文

Kubernetes之kubeadm集群监控篇—node-exporter部署_kube 监控 node

kube 监控 node

编写node-exporter yaml文件

# cat node-exporter.yaml 
apiVersion: v1
kind: Namespace
metadata:
  name: kube-prom
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: node-exporter
  namespace: kube-prom
  labels:
    k8s-app: node-exporter
spec:
  selector:
    matchLabels:
      k8s-app: node-exporter
  template:
    metadata:
      labels:
        k8s-app: node-exporter
    spec:
      hostPID: true
      hostIPC: true
      hostNetwork: true
      tolerations:
      - key: node-role.kubernetes.io/master
        operator: Exists
        effect: NoSchedule
      restartPolicy: Always
      containers:
      - image: registry.cn-beijing.aliyuncs.com/mayaping/node-exporter:v1.0.1
        imagePullPolicy: IfNotPresent
        name: node-exporter
        args:
        - --path.procfs
        - /host/proc
        - --path.sysfs
        - /host/sys
        - --collector.filesystem.ignored-mount-points
        - '"^/(sys|proc|dev|host|etc)($|/)"'
        ports:
        - containerPort: 9100
          protocol: TCP
          name: http
        securityContext:
          privileged: true
        volumeMounts:
        - name: dev
          mountPath: /host/dev
        - name: proc
          mountPath: /host/proc
        - name: sys
          mountPath: /host/sys
        - name: rootfs
          mountPath: /rootfs
      volumes:
      - name: proc
        hostPath:
          path: /proc
      - name: dev
        hostPath:
          path: /dev
      - name: sys
        hostPath:
          path: /sys
      - name: rootfs
        hostPath:
          path: /

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70

部署node-exporter

# kubectl apply -f node-exporter.yaml 
namespace/kube-prom unchanged
daemonset.apps/node-exporter created
  • 1
  • 2
  • 3

查看pod容器情况

# kubectl get pods --namespace kube-prom 
NAME                          READY   STATUS    RESTARTS   AGE
node-exporter-7fh6k           1/1     Running   0          3m19s
node-exporter-dws9d           1/1     Running   0          3m19s
node-exporter-q29ll           1/1     Running   0          3m19s
prometheus-7749bcdfd8-44p9p   1/1     Running   0          134m
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/378687
推荐阅读
相关标签
  

闽ICP备14008679号