-
Notifications
You must be signed in to change notification settings - Fork 26
/
k8s-budget-peer.yaml
105 lines (95 loc) · 2.51 KB
/
k8s-budget-peer.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
# YAML for launching the orderer
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: budget-peer
labels:
app: budget-peer
spec:
serviceName: budget-peer
replicas: 1
selector:
matchLabels:
app: budget-peer
template:
metadata:
labels:
app: budget-peer
spec:
containers:
- name: budget-peer
# image used
image: acloudfan/k8s-hlf-budget-peer:1.0
# Uncomment the following during development/testing of the image
# imagePullPolicy: Always
env:
- name: FABRIC_CFG_PATH
value: /var/hyperledger/config
- name: FABRIC_LOGGING_SPEC
value: DEBUG
- name: ORDERER_ADDRESS
value: acme-orderer-clusterip:30750
- name: ORG_CONTEXT
value: budget
- name: CORE_PEER_ADDRESS
# value: budget-peer-clusterip:30851
value: 0.0.0.0:30851
volumeMounts:
- name: budget-peer-ledger
mountPath: /var/ledger
- name: dockersock
mountPath: /var/run/docker.sock
volumes:
- name: dockersock
hostPath:
path: /var/run/docker.sock
volumeClaimTemplates:
- metadata:
name: budget-peer-ledger
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: general
resources:
requests:
storage: 1Gi
---
# Expose the port 30851 as ClusterIP
apiVersion: v1
kind: Service
metadata:
name: budget-peer-clusterip
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:
app: budget-peer
ports:
- name: budget-peer-clusterip
port: 30851
# - name: budget-peer-cc-clusterip
# port: 30852
type: ClusterIP
---
# Expose the port 30851 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: budget-peer-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:
app: budget-peer
ports:
- name: budget-peer-nodeport-851
port: 30851
nodePort: 30851
- name: budget-peer-cc-nodeport-852
port: 30852
nodePort: 30852
type: NodePort