apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: function-nodes
  labels:
    role: function
spec:
  selector:
    matchLabels:
      role: function
  template:
    metadata:
      labels:
        role: function
    spec:
      nodeSelector:
        role: function
      restartPolicy: Always
      volumes:
      - name: ipc
        hostPath:
          path: /dev/shm
      hostNetwork: true
      hostIPC: true
      containers:
      - name: function-1
        resources:
          limits:
            cpu: "1"
            memory: "1G"
        image: cheneyyu/test_cb
        imagePullPolicy: Always
        env:
        - name: ROUTE_ADDR
          value: ROUTE_ADDR_DUMMY
        - name: MGMT_IP
          value: MGMT_IP_DUMMY
        - name: SCHED_IPS
          value: SCHED_IPS_DUMMY
        - name: THREAD_ID
          value: "0"
        - name: ROLE
          value: executor
        - name: REPO_ORG
          value: hydro-project
        - name: REPO_BRANCH
          value: master
        - name: ANNA_REPO_ORG
          value: hydro-project
        - name: ANNA_REPO_BRANCH
          value: master
        - name: STORAGE_OR_DEFAULT
          value: STORAGE_OR_DEFAULT_DUMMY
        volumeMounts:
        - mountPath: /requests
          name: ipc
      - name: function-2
        resources:
          limits:
            cpu: "1"
            memory: "1G"
        image: cheneyyu/test_cb
        imagePullPolicy: Always
        env:
        - name: ROUTE_ADDR
          value: ROUTE_ADDR_DUMMY
        - name: MGMT_IP
          value: MGMT_IP_DUMMY
        - name: SCHED_IPS
          value: SCHED_IPS_DUMMY
        - name: THREAD_ID
          value: "1"
        - name: ROLE
          value: executor
        - name: REPO_ORG
          value: hydro-project
        - name: REPO_BRANCH
          value: master
        - name: ANNA_REPO_ORG
          value: hydro-project
        - name: ANNA_REPO_BRANCH
          value: master
        - name: STORAGE_OR_DEFAULT
          value: STORAGE_OR_DEFAULT_DUMMY
        volumeMounts:
        - mountPath: /requests
          name: ipc
      # - name: function-3
      #   image: cheneyyu/test_cb
      #   imagePullPolicy: Always
      #   resources:
      #     limits:
      #       cpu: "2"
      #       memory: "2G"
      #   env:
      #   - name: ROUTE_ADDR
      #     value: ROUTE_ADDR_DUMMY
      #   - name: MGMT_IP
      #     value: MGMT_IP_DUMMY
      #   - name: SCHED_IPS
      #     value: SCHED_IPS_DUMMY
      #   - name: THREAD_ID
      #     value: "2"
      #   - name: ROLE
      #     value: executor
      #   - name: REPO_ORG
      #     value: hydro-project
      #   - name: REPO_BRANCH
      #     value: master
      #   - name: ANNA_REPO_ORG
      #     value: hydro-project
      #   - name: ANNA_REPO_BRANCH
      #     value: master
      #   volumeMounts:
      #   - mountPath: /requests
      #     name: ipc
      - name: local-kvs
        image: cheneyyu/ephe_kvs
        imagePullPolicy: Always
        resources:
          limits:
            cpu: 1
            memory: "2G"
        env:
        - name: COORD_IPS
          value: COORD_IPS_DUMMY
        - name: USE_EXETERNAL_CONF
          value: "0"
        - name: FUNC_OR_KVS
          value: "1"
        volumeMounts:
        - mountPath: /requests
          name: ipc
