##
# Node agent with flexvolume driver that creates credential files under
# the 'test-mgmt'/creds directory.
# TBD: Change the nodeagent image to be one that reads from the cred's directory.
##
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: nodeagent
spec:
  template:
    metadata:
      labels:
        app: nodeagent
        version: v1
    spec:
      initContainers:
        - name: flexvol-driver
          image: quay.io/saurabh/flexvol:81f7a44
          imagePullPolicy: Always
          volumeMounts:
            - name: flexvol-driver-host
              mountPath: /host/driver
      containers:
        - name: nodeagent
          image: quay.io/saurabh/nodeagent:178c1fa
          imagePullPolicy: Always
          volumeMounts:
            - name: test-mgmt
              mountPath: /tmp/udsuspver
            - name: test-workload
              mountPath: /tmp/nodeagent
      volumes:
        - name: test-mgmt
          hostPath:
            # directory location on host for the mgmt api
            type: DirectoryOrCreate
            path: /var/run/nodeagent
        - name: test-workload
          hostPath:
            type: DirectoryOrCreate
            path: /var/run/nodeagent/mount
        - name: flexvol-driver-host
          hostPath:
            type: DirectoryOrCreate
            path: /usr/libexec/kubernetes/kubelet-plugins/volume/exec/nodeagent~uds
