-
Notifications
You must be signed in to change notification settings - Fork 0
/
peer0-netflix.yaml
152 lines (140 loc) · 4.58 KB
/
peer0-netflix.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# YAML for launching peer0 netflix
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: peer0-netflix-myapp
labels:
run: peer0-netflix-myapp
spec:
serviceName: peer0-netflix-myapp
replicas: 1
selector:
matchLabels:
run: peer0-netflix-myapp
template:
metadata:
labels:
run: peer0-netflix-myapp
spec:
containers:
- name: peer0-netflix-myapp
# Image used
image: hyperledger/fabric-peer
env:
- name: FABRIC_CFG_PATH
value: /etc/hyperledger/fabric
- name: FABRIC_LOGGING_SPEC
value: DEBUG
- name: CORE_PEER_ID
value: peer0-netflix-myapp
- name: CORE_PEER_ADDRESS
value: peer0-netflix-myapp:7051
#value: 0.0.0.0:7051
- name: CORE_PEER_LISTENADDRESS
value: 0.0.0.0:7051
- name: CORE_PEER_CHAINCODEADDRESS
value: peer0-netflix-myapp:7052
- name: CORE_PEER_CHAINCODELISTENADDRESS
value: 0.0.0.0:7052
- name: CORE_PEER_LOCALMSPID
value: netflixMSP
- name: CORE_PEER_TLS_ENABLED
value: "true"
- name: CORE_PEER_PROFILE_ENABLED
value: "true"
- name: CORE_PEER_TLS_CERT_FILE
value: /etc/hyperledger/fabric/tls/server.crt
- name: CORE_PEER_TLS_KEY_FILE
value: /etc/hyperledger/fabric/tls/server.key
- name: CORE_PEER_TLS_ROOTCERT_FILE
value: /etc/hyperledger/fabric/tls/ca.crt
- name: CORE_VM_ENDPOINT
value: unix:///host/var/run/docker.sock
- name: ORDERER_ADDRESS
value: orderer-myapp:7050
- name: CORE_PEER_MSPCONFIGPATH
value: /etc/hyperledger/fabric/users/Admin@netflix-myapp/msp
workingDir: /etc/hyperledger/fabric
volumeMounts:
- name: peer0-netflix-myapp-ledger
mountPath: /var/ledger
- name: dockersock
mountPath: /var/run/docker.sock
- name: my-pvc-nfs
mountPath: /etc/hyperledger/fabric/msp
subPath: crypto-config/peerOrganizations/netflix-myapp/peers/peer0-netflix-myapp/msp
- name: my-pvc-nfs
mountPath: /etc/hyperledger/fabric/tls
subPath: crypto-config/peerOrganizations/netflix-myapp/peers/peer0-netflix-myapp/tls
- name: my-pvc-nfs
mountPath: /etc/hyperledger/fabric/users
subPath: crypto-config/peerOrganizations/netflix-myapp/users
- name: my-pvc-nfs
mountPath: /etc/hyperledger/fabric/chaincode
subPath: chaincode
- name: my-pvc-nfs
mountPath: /etc/hyperledger/fabric/channel-artifacts
subPath: channel-artifacts
- name: my-pvc-nfs
mountPath: /var/hyperledger/production
subPath: crypto-config/peerOrganizations/netflix-myapp/peers/peer0-netflix-myapp
- name: my-pvc-nfs
mountPath: /etc/hyperledger/fabric/crypto
subPath: crypto-config
volumes:
- name: dockersock
hostPath:
path: /var/run/docker.sock
- name: my-pvc-nfs
persistentVolumeClaim:
claimName: nfs
volumeClaimTemplates:
- metadata:
name: peer0-netflix-myapp-ledger
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: general
resources:
requests:
storage: 1Gi
---
# Expose the port 7051 as ClusterIP
apiVersion: v1
kind: Service
metadata:
name: peer0-netflix-myapp
spec:
# This defines which pods are going to be represented by this Service
# The service becomes a network endpoint for either other services
# or maybe external users to connect to (eg browser)
selector:
run: peer0-netflix-myapp
ports:
- name: peer0-netflix-myapp
port: 7051
- name: peer0-netflix-myapp-cc
port: 7052
type: ClusterIP
---
# Expose the port 7051 as node port - NEEDED if you
# are interested in connecting to the Pods from the Host
# machine - keep in mind you would need the IP for the node
# port service
apiVersion: v1
kind: Service
metadata:
name: peer0-netflix-myapp-nodeport
spec:
# This defines which pods are going to be represented by this Service
# The service becomes a network endpoint for either other services
# or maybe external users to connect to (eg browser)
selector:
run: peer0-netflix-myapp
ports:
- name: peer0-netflix-myapp-nodeport-7051
port: 30751
nodePort: 30751
- name: peer0-netflix-myapp-cc-nodeport-7052
port: 30752
nodePort: 30752
type: NodePort