apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: resource-topology-exporter
spec:
  selector:
      matchLabels:
        name: resource-topology
  template:
    metadata:
      labels:
        name: resource-topology
    spec:
      serviceAccountName: rte
      containers:
      - name: resource-topology-exporter-container
        image: ${RTE_CONTAINER_IMAGE}
        command:
        - /bin/resource-topology-exporter
        - --export-namespace=${EXPORT_NAMESPACE}
        - --sleep-interval=${RTE_POLL_INTERVAL}
        - --sysfs=/host-sys
        - --kubelet-state-dir=/host-var/lib/kubelet
        - --podresources-socket=unix:///host-var/lib/kubelet/pod-resources/kubelet.sock
        env:
        - name: NODE_NAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName
        - name: REFERENCE_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: REFERENCE_POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: REFERENCE_CONTAINER_NAME
          value: shared-pool-container
        volumeMounts:
          - name: host-sys
            mountPath: "/host-sys"
            readOnly: true
          - name: host-conf
            mountPath: "/host-var/lib/kubelet/config.yaml"
            readOnly: true
          - name: host-podresources
            mountPath: "/host-var/lib/kubelet/pod-resources"
      - name: shared-pool-container
        image: gcr.io/google_containers/pause-amd64:3.0
      volumes:
      - name: host-sys
        hostPath:
          path: "/sys"
      - name: host-conf
        hostPath:
          path: "/var/lib/kubelet/config.yaml"
      - name: host-podresources
        hostPath:
          path: "/var/lib/kubelet/pod-resources"
