apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: storage-adapter-edge2
spec:
  selector:
    matchLabels:
      name: storage-adapter
  template:
    metadata:
      labels:
        name: storage-adapter
        zone: edge2
    spec:
      # tolerations:
      # this toleration is to have the daemonset runnable on master nodes
      # remove it if your masters can't run pods
      # - key: node-role.kubernetes.io/master
      #   effect: NoSchedule
      containers:
      - name: storage-adapter
        image: alincorodescu/msc-workflows-storage-adapter:latest        
        imagePullPolicy: Always
        volumeMounts:
        - name: store
          mountPath: /store
        ports:
          - containerPort: 5001
            hostPort: 5001
          - containerPort: 6000
            hostPort: 6000
        env:
          - name: UseHardLinking
            value: "true"
          - name: UseConnectionPooling
            value: "true"
          - name: ASPNETCORE_URLS
            value: http://+:5001
          - name: NODE_IP
            valueFrom:
              fieldRef: 
                fieldPath: status.hostIP
          - name: LOCALIZATION_HOST
            valueFrom:
              fieldRef: 
                fieldPath: status.hostIP
          - name: LOCALIZATION_ZONE
            valueFrom:
              fieldRef: 
                fieldPath: metadata.labels['zone']
      volumes:
      - name: store
        hostPath:
          path: /store
      nodeSelector:
        zone: edge2
