#
# Copyright (c) 2019 LG Electronics Inc.
# SPDX-License-Identifier: Apache-2.0
#

---
apiVersion: apps/v1 
kind: Deployment
metadata:
  name: esearchfeeder-deployment
spec:
  selector:
    matchLabels:
      app: esearchfeeder
  replicas: 1
  template:
    metadata:
      labels:
        app: esearchfeeder
    spec:
      volumes:
      - name: bookmarkvolume
        persistentVolumeClaim:
          claimName: esfeeder-pvc
      containers:
      - name: esearchfeeder
        image: lgsvlfx/data-marketplace-esearchfeeder:ci
        imagePullPolicy: Always
        env:
        - name: INDEX_TIMES
          value: "{\"DataContractType\":300}"
        - name: INDEX_PATHS
          value: "{\"DataContractType\":\"api/queries/getDataContractTypesAfterTimeStamp\"}"
        - name: ELASTIC_SEARCH_URL
          value: http://elasticsearch:9200
        - name: CHAINCODE_REST_URL
          value: http://chaincode-rest-service:9090
        - name: AUTHORIZATION #you should create this secret with a valid token
          valueFrom:
            secretKeyRef:
              name: mytoken
              key: AUTHORIZATION #
        volumeMounts:
        - name: bookmarkvolume
          mountPath: /var/run/esfeeder