apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: power-node-agent
  namespace: intel-power
spec:
  selector:
    matchLabels:
      name: power-node-agent-pod
  template:
    metadata:
      namespace: intel-power
      labels:
        name: power-node-agent-pod
    spec:
      serviceAccountName: intel-power-operator
      containers:
        - image: 'intel-power-node-agent:latest'
          imagePullPolicy: IfNotPresent
          securityContext:
            allowPrivilegeEscalation: false
            readOnlyRootFilesystem: true
            capabilities:
              drop: ["ALL"]
          name: power-node-agent
          env:
            - name: NODE_NAME
              valueFrom:
                fieldRef:
                  fieldPath: spec.nodeName
          resources:
            limits:
              cpu: 100m
              memory: 30Mi
            requests:
              cpu: 100m
              memory: 30Mi
          volumeMounts:
            - mountPath: /sys/fs
              name: cgroup
              readOnly: true
            - mountPath: /etc/certs/public
              name: appqoscerts
              readOnly: true
            - mountPath: /var/lib/kubelet/pod-resources/
              name: kubesock
              readOnly: true
        - image: 'appqos:latest'
          imagePullPolicy: IfNotPresent
          name: appqos
          ports:
          - containerPort: 5000
          volumeMounts:
          - mountPath: /appqos_workspace/appqos/ca
            name: appqoscerts
            readOnly: true
          - mountPath: /dev/cpu/0
            name: dev
            readOnly: true
          securityContext:
            privileged: true
      volumes:
        - name: appqoscerts
          hostPath:
            path: /etc/certs/public/
        - name: cgroup
          hostPath:
            path: /sys/fs
        - name: kubesock
          hostPath:
            path: /var/lib/kubelet/pod-resources
        - name: dev
          hostPath:
            path: /dev/cpu/0
