mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-20 08:35:09 +00:00
- Add a new label to each peer to mark which org it is in - Create new service per org, that matches this label - so the service can pick from one of multiple pods - Update the kubeproxy to give more choice of ha stratergies - Update the application configmaps and samples to refer to this new service rather than specific peers Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
117 lines
3.6 KiB
YAML
117 lines
3.6 KiB
YAML
#
|
|
# Copyright IBM Corp. All Rights Reserved.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: org2-peer1-config
|
|
data:
|
|
FABRIC_CFG_PATH: /var/hyperledger/fabric/config
|
|
FABRIC_LOGGING_SPEC: "debug:cauthdsl,policies,msp,grpc,peer.gossip.mcs,gossip,leveldbhelper=info"
|
|
CORE_PEER_TLS_ENABLED: "true"
|
|
CORE_PEER_TLS_CERT_FILE: /var/hyperledger/fabric/organizations/peerOrganizations/org2.example.com/peers/org2-peer1.org2.example.com/tls/signcerts/cert.pem
|
|
CORE_PEER_TLS_KEY_FILE: /var/hyperledger/fabric/organizations/peerOrganizations/org2.example.com/peers/org2-peer1.org2.example.com/tls/keystore/server.key
|
|
CORE_PEER_TLS_ROOTCERT_FILE: /var/hyperledger/fabric/organizations/peerOrganizations/org2.example.com/peers/org2-peer1.org2.example.com/tls/cacerts/org2-tls-ca.pem
|
|
CORE_PEER_ID: org2-peer1.org2.example.com
|
|
CORE_PEER_ADDRESS: org2-peer1:7051
|
|
CORE_PEER_LISTENADDRESS: 0.0.0.0:7051
|
|
CORE_PEER_CHAINCODEADDRESS: org2-peer1:7052
|
|
CORE_PEER_CHAINCODELISTENADDRESS: 0.0.0.0:7052
|
|
# bootstrap peer is the other peer in the same org
|
|
CORE_PEER_GOSSIP_BOOTSTRAP: org2-peer2:7051
|
|
CORE_PEER_GOSSIP_EXTERNALENDPOINT: org2-peer1:7051
|
|
CORE_PEER_LOCALMSPID: Org2MSP
|
|
CORE_PEER_MSPCONFIGPATH: /var/hyperledger/fabric/organizations/peerOrganizations/org2.example.com/peers/org2-peer1.org2.example.com/msp
|
|
CORE_OPERATIONS_LISTENADDRESS: 0.0.0.0:9443
|
|
CORE_PEER_FILESYSTEMPATH: /var/hyperledger/fabric/data/org2-peer1.org2.example.com
|
|
CORE_LEDGER_SNAPSHOTS_ROOTDIR: /var/hyperledger/fabric/data/org2-peer1.org2.example.com/snapshots
|
|
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: org2-peer1
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: org2-peer1
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: org2-peer1
|
|
org: org2
|
|
spec:
|
|
containers:
|
|
- name: main
|
|
image: {{FABRIC_CONTAINER_REGISTRY}}/fabric-peer:{{FABRIC_VERSION}}
|
|
imagePullPolicy: IfNotPresent
|
|
envFrom:
|
|
- configMapRef:
|
|
name: org2-peer1-config
|
|
ports:
|
|
- containerPort: 7051
|
|
- containerPort: 7052
|
|
- containerPort: 9443
|
|
volumeMounts:
|
|
- name: fabric-volume
|
|
mountPath: /var/hyperledger
|
|
- name: fabric-config
|
|
mountPath: /var/hyperledger/fabric/config
|
|
- name: ccs-builder
|
|
mountPath: /var/hyperledger/fabric/chaincode/ccs-builder/bin
|
|
|
|
# load the external chaincode builder into the peer image prior to peer launch.
|
|
initContainers:
|
|
- name: fabric-ccs-builder
|
|
image: ghcr.io/hyperledgendary/fabric-ccs-builder
|
|
imagePullPolicy: IfNotPresent
|
|
command: [sh, -c]
|
|
args: ["cp /go/bin/* /var/hyperledger/fabric/chaincode/ccs-builder/bin/"]
|
|
volumeMounts:
|
|
- name: ccs-builder
|
|
mountPath: /var/hyperledger/fabric/chaincode/ccs-builder/bin
|
|
|
|
volumes:
|
|
- name: fabric-volume
|
|
persistentVolumeClaim:
|
|
claimName: fabric-org2
|
|
- name: fabric-config
|
|
configMap:
|
|
name: org2-config
|
|
- name: ccs-builder
|
|
emptyDir: {}
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: org2-peer1
|
|
spec:
|
|
ports:
|
|
- name: gossip
|
|
port: 7051
|
|
protocol: TCP
|
|
- name: chaincode
|
|
port: 7052
|
|
protocol: TCP
|
|
- name: operations
|
|
port: 9443
|
|
protocol: TCP
|
|
selector:
|
|
app: org2-peer1
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: org2-peer-gateway-svc
|
|
spec:
|
|
ports:
|
|
- name: gossip
|
|
port: 7051
|
|
protocol: TCP
|
|
selector:
|
|
org: org2
|