yurake/k8s-3tier-webapp

View on GitHub
kubernetes/monitoring/node-exporter/node-exporter-daemonset.yaml

Summary

Maintainability
Test Coverage
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: node-exporter
  namespace: monitoring
  labels:
    app: node-exporter
    kubernetes.io/cluster-service: "true"
    addonmanager.kubernetes.io/mode: Reconcile
spec:
  selector:
    matchLabels:
      app: node-exporter
  updateStrategy:
    type: OnDelete
  template:
    metadata:
      labels:
        tier: management
        component: monitoring
        app: node-exporter
    spec:
      containers:
        - name: prometheus-node-exporter
          image: prom/node-exporter:v1.8.2
          imagePullPolicy: Always
          args:
            - --path.procfs=/proc
            - --path.sysfs=/sys
          ports:
            - name: metrics
              containerPort: 9100
              hostPort: 9100
          livenessProbe:
            tcpSocket:
              port: 9100
          readinessProbe:
            tcpSocket:
              port: 9100
          volumeMounts:
            - name: node-exporter-persistent-storage-proc
              mountPath: /host/proc
              readOnly: true
            - name: node-exporter-persistent-storage-sys
              mountPath: /host/sys
              readOnly: true
      hostNetwork: true
      hostPID: true
      volumes:
        - name: node-exporter-persistent-storage-proc
          persistentVolumeClaim:
            claimName: node-exporter-pvc-proc
        - name: node-exporter-persistent-storage-sys
          persistentVolumeClaim:
            claimName: node-exporter-pvc-sys