apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: theykk-logger
  namespace: logger
  labels:
    app: theykk-logger
spec:
  selector:
    matchLabels:
      app: theykk-logger
  template:
    metadata:
      labels:
        app: theykk-logger
    spec:
      containers:
      - name: theykk-logger
        image: theykk/logger:v0.2.16
        imagePullPolicy: Always
        env:
        - name: MONGO_URI
          valueFrom:
            secretKeyRef:
              name: theykk-logger
              key: MONGO_URI
        - name: KUBE_HOSTNAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName
        resources:
          requests:
            cpu: 50m
          limits:
            memory: 200Mi
        volumeMounts:
        - name: varlog
          mountPath: /var/log
        - name: varlibdockercontainers
          mountPath: /var/lib/docker/containers
          readOnly: true
      volumes:
      - name: varlog
        hostPath:
          path: /var/log
      - name: varlibdockercontainers
        hostPath:
          path: /var/lib/docker/containers
