apiVersion: apps/v1
kind: DaemonSet
metadata:
  labels:
    app: log-linker
  name: log-linker
  namespace: log-linker
spec:
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: log-linker
  template:
    metadata:
      labels:
        app: log-linker
    spec:
      containers:
      - command:
        - /log-linker.sh
        image: registry.gitlab.rotate-it.be/kris/loglinker:latest
        imagePullPolicy: Always
        name: log-linker
        resources: {}
        securityContext:
          allowPrivilegeEscalation: true
          privileged: true
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /var/lib/docker
          name: var-lib-docker
        - mountPath: /var/log
          name: var-log
      dnsPolicy: ClusterFirst
      initContainers:
      - args:
        - mkdir -p /var/log/containers; mkdir -p /var/log/pods
        command:
        - /bin/sh
        - -c
        image: busybox
        imagePullPolicy: Always
        name: mk-log-dir
        resources: {}
        securityContext:
          allowPrivilegeEscalation: true
          capabilities: {}
          privileged: true
          readOnlyRootFilesystem: false
          runAsNonRoot: false
        stdin: true
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        tty: true
        volumeMounts:
        - mountPath: /var/log
          name: var-log
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
      volumes:
      - hostPath:
          path: /var/log
          type: ""
        name: var-log
      - hostPath:
          path: /var/lib/docker
          type: ""
        name: var-lib-docker
