apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: log-dump-node
spec:
  selector:
    matchLabels:
      app: log-dump-node
  template:
    metadata:
      labels:
        app: log-dump-node
    spec:
      containers:
      - name: log-dump-node
        image: fedora:30 # A base image that has 'journalctl' binary
        args:
        - sleep
        - "3600"
        volumeMounts:
        - name: varlog
          mountPath: /var/log
        - name: runlog
          mountPath: /run/log
      nodeSelector:
        kubernetes.io/os: linux
      tolerations:
      - effect: NoSchedule
        key: node-role.kubernetes.io/master
        operator: Equal
        value: "true"
      - effect: NoSchedule
        key: node-role.kubernetes.io/control-plane
        operator: Equal
        value: "true"
      - effect: NoExecute
        operator: Exists
      - effect: NoSchedule
        operator: Exists
      - key: CriticalAddonsOnly
        operator: Exists
      volumes:
      - name: varlog
        hostPath:
          path: /var/log
      - name: runlog
        hostPath:
          path: /run/log
