---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: nsmgr
spec:
  selector:
    matchLabels:
      app: nsmgr-daemonset
  template:
    metadata:
      labels:
        app: nsmgr-daemonset
    spec:
      containers:
        - name: nsmdp
          image: networkservicemesh/nsmdp
          imagePullPolicy: IfNotPresent
          volumeMounts:
            - name: kubelet-socket
              mountPath: /var/lib/kubelet/device-plugins
            - name: nsm-socket
              mountPath: /var/lib/networkservicemesh
        - name: nsmd
          image: networkservicemesh/devenv:latest
          imagePullPolicy: IfNotPresent
          volumeMounts:
            - name: nsm-socket
              mountPath: /var/lib/networkservicemesh
            - name: sources
              mountPath: /go/src
            - name: nsm-plugin-socket
              mountPath: /var/lib/networkservicemesh/plugins
        - name: nsmd-k8s
          image: networkservicemesh/nsmd-k8s
          imagePullPolicy: IfNotPresent
          volumeMounts:
            - name: nsm-plugin-socket
              mountPath: /var/lib/networkservicemesh/plugins
          env:
            - name: NODE_NAME
              valueFrom:
                fieldRef:
                  fieldPath: spec.nodeName
      volumes:
        - hostPath:
            path: /var/lib/kubelet/device-plugins
            type: DirectoryOrCreate
          name: kubelet-socket
        - hostPath:
            path: /var/lib/networkservicemesh
            type: DirectoryOrCreate
          name: nsm-socket
        - hostPath:
            path: /go/src
            type: DirectoryOrCreate
          name: sources
        - hostPath:
            path: /var/lib/networkservicemesh/plugins
            type: DirectoryOrCreate
          name: nsm-plugin-socket
