apiVersion: apps/v1
kind: Deployment
metadata:
    name: cli-peer0-org2
spec:
    selector:
        matchLabels:
            name: cli-peer0-org2
    template:
        metadata:
            labels:
                name: cli-peer0-org2
        spec:
            volumes:
                - name: fabricfiles
                  persistentVolumeClaim:
                      claimName: mypvc

            containers:
                - name: cli-peer0-org2
                  stdin: true
                  tty: true
                  resources:
                        limits:
                          memory: "300Mi"
                          cpu: "200m"
                        requests:
                          memory: "200Mi"
                          cpu: "90m"
                  image: hyperledger/fabric-tools:2.3
                  workingDir: /
                  env:
                      - name: ORDERER_CA
                        value: /organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

                      - name: CORE_PEER_ADDRESS
                        value: peer0-org2:7051
                      - name: CORE_PEER_ID
                        value: cli.peer0.org2.example.com
                      - name: CORE_PEER_LOCALMSPID
                        value: Org2MSP
                      - name: CORE_PEER_MSPCONFIGPATH
                        value: /organizations/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
                      - name: CORE_PEER_TLS_CERT_FILE
                        value: /organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/server.crt
                      - name: CORE_PEER_TLS_ENABLED
                        value: "true"
                      - name: CORE_PEER_TLS_KEY_FILE
                        value: /organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/server.key
                      - name: CORE_PEER_TLS_ROOTCERT_FILE
                        value: /organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
                      - name: FABRIC_LOGGING_SPEC
                        value: ERROR
                      - name: GOPATH
                        value: /opt/gopath
                      - name: SYS_CHANNEL
                        value: system-channel
                      - name: CORE_CHAINCODE_BUILDER
                        value: hyperledger/fabric-ccenv:1.4.8
                      - name: FABRIC_LOGGING_SPEC
                        value: DEBUG
                  volumeMounts:
                      - mountPath: /configtx
                        name: fabricfiles
                        subPath: configtx
                      - mountPath: /organizations
                        name: fabricfiles
                        subPath: organizations
                      - mountPath: /channel-artifacts
                        name: fabricfiles
                        subPath: channel-artifacts
                      - mountPath: /scripts
                        name: fabricfiles
                        subPath: scripts
                      - mountPath: /opt/gopath/src/github.com/chaincode
                        name: fabricfiles
                        subPath: chaincode
