---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: vector
  namespace: vector-agent
  annotations: {}
  labels:
    app.kubernetes.io/name: vector
    app.kubernetes.io/instance: vector
    app.kubernetes.io/component: Agent
    app.kubernetes.io/version: "0.24.0-distroless-libc"
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: vector
      app.kubernetes.io/instance: vector
      app.kubernetes.io/component: Agent
  template:
    metadata:
      annotations: {}
      labels:
        app.kubernetes.io/name: vector
        app.kubernetes.io/instance: vector
        app.kubernetes.io/component: Agent
        vector.dev/exclude: "true"
    spec:
      serviceAccountName: vector
      dnsPolicy: ClusterFirst
      containers:
        - name: vector
          resources:
            requests:
              memory: "500Mi"
              cpu: "20m"
            limits:
              memory: "1024Mi"
              cpu: "1000m"
          image: "timberio/vector:0.24.0-distroless-libc"
          imagePullPolicy: Always
          args:
            - --config-dir
            - /etc/vector/
          env:
            - name: VECTOR_WATCH_CONFIG
              value: "true"
            - name: VECTOR_SELF_NODE_NAME
              valueFrom:
                fieldRef:
                  fieldPath: spec.nodeName
            - name: VECTOR_SELF_POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: VECTOR_SELF_POD_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: PROCFS_ROOT
              value: "/host/proc"
            - name: SYSFS_ROOT
              value: "/host/sys"
          ports:
            - name: demolog
              containerPort: 9090
              protocol: TCP
            - name: api
              containerPort: 8686
              protocol: TCP
          volumeMounts:
            - name: data
              mountPath: "/vector-data-dir"
            - name: config
              mountPath: "/etc/vector/"
              readOnly: true
            - name: var-log
              mountPath: "/var/log/"
              readOnly: true
            - name: var-lib
              mountPath: "/var/lib"
              readOnly: true
            - name: procfs
              mountPath: "/host/proc"
              readOnly: true
            - name: sysfs
              mountPath: "/host/sys"
              readOnly: true
      terminationGracePeriodSeconds: 60
      volumes:
        - name: config
          projected:
            sources:
              - configMap:
                  name: vector
        - name: data
          hostPath:
            path: "/var/lib/vector"
        - name: var-log
          hostPath:
            path: "/var/log/"
        - name: var-lib
          hostPath:
            path: "/var/lib/"
        - name: procfs
          hostPath:
            path: "/proc"
        - name: sysfs
          hostPath:
            path: "/sys"
