apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: oomkill-exporter
  labels:
    app: oomkill-exporter
spec:
  selector:
    matchLabels:
      app: oomkill-exporter
  template:
    metadata:
      labels:
        app: oomkill-exporter
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "9102"
    spec:
      containers:
      - name: oomkill-exporter
        image: sapcc/kubernetes-oomkill-exporter:0.3.1
        imagePullPolicy: IfNotPresent
        args:
        - -logtostderr
        - -v=5
        securityContext:
          privileged: true
        resources:
          limits:
            cpu: 100m
            memory: 100Mi
          requests:
            cpu: 20m
            memory: 20Mi
        env:
        - name: DOCKER_HOST
          value: "unix:///var/run/docker.sock"
        volumeMounts:
        - name: kmsg
          mountPath: /dev/kmsg
          readOnly: true
        - name: docker
          mountPath: /var/run/docker.sock 
        ports:
        - name: metrics
          containerPort: 9102
      tolerations:
      - operator: Exists
      volumes:
      - name: kmsg
        hostPath:
          path: /dev/kmsg
      - name: docker
        hostPath:
          path: /var/run/docker.sock

