# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: fpcclient-org2
  name: fpcclient-org2
  namespace: hyperledger
spec:
  selector:
    matchLabels:
      app: fpcclient-org2
  replicas: 1
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: fpcclient-org2
    spec:
      containers:
        - env:
            - name: SGX_MODE
              value: SIM
            - name: CC_NAME
              value: fpccc
            - name: CHANNEL_NAME
              value: mychannel
            - name: GATEWAY_CONFIG
              value: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2/connection.yaml
            - name: ORG
              value: org2
            - name: FABRIC_LOGGING_SPEC
              value: INFO
            - name: CORE_PEER_ADDRESS
              value: peer0-org2:7051
            - name: CORE_PEER_ID
              value: peer0-org2
            - name: CORE_PEER_LOCALMSPID
              value: org2MSP
            - name: CORE_PEER_MSPCONFIGPATH
              value: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2/users/Admin@org2/msp
            - name: CORE_PEER_TLS_CERT_FILE
              value: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2/peers/peer0-org2/tls/server.crt
            - name: CORE_PEER_TLS_ENABLED
              value: "true"
            - name: CORE_PEER_TLS_KEY_FILE
              value: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2/peers/peer0-org2/tls/server.key
            - name: CORE_PEER_TLS_ROOTCERT_FILE
              value: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2/peers/peer0-org2/tls/ca.crt
            - name: GOPATH
              value: /opt/gopath
            - name: ORDERER_CA
              value: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/consortium/orderers/orderer0/msp/tlscacerts/tlsca.consortium-cert.pem
            - name: FPC_PATH
              value: /opt/gopath/src/github.com/hyperledger-labs/fabric-private-chaincode/
          image: fpc/fpcclient
          imagePullPolicy: IfNotPresent
          name: fpcclient
          tty: true
          volumeMounts:
            - mountPath: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
              name: fpcclient-claim3
            - mountPath: /opt/gopath/src/github.com/hyperledger-labs/fabric-private-chaincode/
              name: fpc-claim
          workingDir: /opt/gopath/src/github.com/hyperledger/fabric/peer
      restartPolicy: Always
      volumes:
        - name: fpcclient-claim3
          hostPath:
            path: /fpc/integration/k8s/demo/crypto-config
            type: Directory
        - name: fpc-claim
          hostPath:
            path: /fpc
            type: Directory


