---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: nsmgr
  labels:
    app: nsmgr
spec:
  selector:
    matchLabels:
      app: nsmgr
  template:
    metadata:
      labels:
        app: nsmgr
    spec:
      containers:
        - image: networkservicemeshci/cmd-nsmgr:14d33242
          imagePullPolicy: IfNotPresent
          name: nsmgr
          ports:
            - containerPort: 5001
              hostPort: 5001
          env:
            - name: SPIFFE_ENDPOINT_SOCKET
              value: unix:///run/spire/sockets/agent.sock
            - name: NSM_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: NSM_REGISTRY_URL
              value: "nsm-registry-svc:5002"
            #            - name: DLV_LISTEN_NSMGR
            #              value: :40000
            - name: POD_IP
              valueFrom:
                fieldRef:
                  fieldPath: status.podIP
            - name: NSM_LISTEN_ON
              value: unix:///var/lib/networkservicemesh/nsm.io.sock,tcp://:5001
          volumeMounts:
            - name: spire-agent-socket
              mountPath: /run/spire/sockets
              readOnly: true
            - name: nsm-socket
              mountPath: /var/lib/networkservicemesh
      volumes:
        - name: spire-agent-socket
          hostPath:
            path: /run/spire/sockets
            type: Directory
        - name: nsm-socket
          hostPath:
            path: /var/lib/networkservicemesh
            type: DirectoryOrCreate
