apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: fc-agent
  namespace: ${NAMESPACE}
spec:
  selector:
    matchLabels:
      name: fc-agent
  template:
    metadata:
      labels:
        name: fc-agent
    spec:
      tolerations:
      - key: node-role.kubernetes.io/master
        operator: Exists
        effect: NoSchedule
      containers:
      - args:
        - -config.file=/etc/fc-agent/agent.yaml
        command:
        - /bin/agent
        env:
        - name: HOSTNAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName
        image: grafana-agent:v0.23.0
        imagePullPolicy: IfNotPresent
        name: agent
        volumeMounts:
        - mountPath: /etc/fc-agent
          name: fc-agent
      serviceAccount: fc-agent
      terminationGracePeriodSeconds: 30
      volumes:
      - configMap:
          name: fc-agent
        name: fc-agent
