apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: log-pilot-logstash
  namespace: flink
  labels:
    k8s-app: filebeat-log-pilot
spec:
  selector:
    matchLabels:
      name: log-pilot-logstash
  updateStrategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        name: log-pilot-logstash
    spec:
      tolerations:
      - key: node-role.kubernetes.io/master
        effect: NoSchedule
      containers:
      - name: log-pilot-logstash
        image: hubshwgq.kingsoft.com/datacenter/log-pilot:0.9.7
        env:
          - name: "FILEBEAT_OUTPUT"
            value: "logstash"
          - name: "LOGSTASH_HOST"
            value: "\"logstash3.whale.xoyo.com:5044\",\"logstash4.whale.xoyo.com:5044\""
          - name: "NODE_NAME"
            valueFrom:
              fieldRef:
                fieldPath: spec.nodeName
        volumeMounts:
        - name: sock
          mountPath: /var/run/docker.sock
        - name: logs
          mountPath: /var/log/filebeat
        - name: state
          mountPath: /var/lib/filebeat
        - name: root
          mountPath: /host
          readOnly: true
        - name: localtime
          mountPath: /etc/localtime
        securityContext:
          capabilities:
            add:
            - SYS_ADMIN
      terminationGracePeriodSeconds: 30
      volumes:
      - name: sock
        hostPath:
          path: /var/run/docker.sock
      - name: logs
        hostPath:
          path: /var/log/filebeat
      - name: state
        hostPath:
          path: /var/lib/filebeat
      - name: root
        hostPath:
          path: /
      - name: localtime
        hostPath:
          path: /etc/localtime