Skip to content

Commit

Permalink
[CE-75] Few Bugs fixed in K8s manifests
Browse files Browse the repository at this point in the history
Few bugs were fixed in manifests,
which were not letting the peers joined the K8s CLuster.
Its well tested several time.
Now the chaincode is also installed on all the peers.

Change-Id: I305afe816700007c05780f22bf60fe08ee19f65b
Signed-off-by: Nikhil Chawla <chawlanikhil24@gmail.com>
  • Loading branch information
chawlanikhil24 committed Jul 24, 2017
1 parent abb25b3 commit 01175c9
Show file tree
Hide file tree
Showing 8 changed files with 170 additions and 82 deletions.
4 changes: 2 additions & 2 deletions src/agent/k8s/manifests/fabric-1.0/local/ca.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ spec:
restartPolicy: Always
containers:
- name: ca-container
imagePullPolicy: Never
image: hyperledger/fabric-ca:latest
# imagePullPolicy: Never
image: hyperledger/fabric-ca:x86_64-1.0.0
ports:
- containerPort: 7054
command:
Expand Down
17 changes: 14 additions & 3 deletions src/agent/k8s/manifests/fabric-1.0/local/cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ spec:
restartPolicy: Always
containers:
- name: cli-container
imagePullPolicy: Never
image: hyperledger/fabric-tools:latest
imagePullPolicy: IfNotPresent
image: hyperledger/fabric-tools:x86_64-1.0.0 #The image is changed to fabric-tools in latest version of e2e_cli samples
workingDir: /opt/gopath/src/github.com/hyperledger/fabric/peer
tty: true
volumeMounts:
Expand All @@ -31,7 +31,12 @@ spec:
name: configtx
- mountPath: /etc/hyperledger/fabric/crypto-config.yaml
name: crypto-config
- mountPath: /var/run/docker.sock
name: docker-sock
readOnly: false
env:
- name: CORE_VM_ENDPOINT
value: unix:///var/run/docker.sock
- name: CORE_PEER_ID
value: fabric-cli
- name: CORE_LOGGING_LEVEL
Expand All @@ -41,7 +46,7 @@ spec:
- name: CORE_PEER_LOCALMSPID
value: "Org1MSP"
- name: CORE_PEER_TLS_ENABLED
value: "true"
value: "false"
- name: CORE_PEER_TLS_CERT_FILE
value: "/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt"
- name: CORE_PEER_TLS_KEY_FILE
Expand Down Expand Up @@ -71,3 +76,9 @@ spec:
- name: crypto-config
hostPath:
path: /data/driving-files/crypto-config.yaml
- name: docker-sock
hostPath:
path: /var/run/docker.sock
# - name: kube
# hostPath:
# path: /data/packk
6 changes: 3 additions & 3 deletions src/agent/k8s/manifests/fabric-1.0/local/orderer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ spec:
restartPolicy: Always
containers:
- name: orderer-container
imagePullPolicy: Never
image: hyperledger/fabric-orderer:latest
# imagePullPolicy: Never
image: hyperledger/fabric-orderer:x86_64-1.0.0
volumeMounts:
- mountPath: /var/hyperledger/orderer
name: orderer-vol
Expand Down Expand Up @@ -45,7 +45,7 @@ spec:
- name: ORDERER_GENERAL_LISTENPORT
value: "7050"
- name: ORDERER_GENERAL_TLS_ENABLED
value: "true"
value: "false"
- name: ORDERER_RAMLEDGER_HISTORY_SIZE
value: "100"
- name: CONFIGTX_ORDERER_ORDERERTYPE
Expand Down
Empty file modified src/agent/k8s/manifests/fabric-1.0/local/peer-pod.yaml
100644 → 100755
Empty file.
54 changes: 34 additions & 20 deletions src/agent/k8s/manifests/fabric-1.0/local/peer0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,32 @@ spec:
restartPolicy: Always
containers:
- name: peer0-org1-container
imagePullPolicy: Never
image: hyperledger/fabric-peer:latest
imagePullPolicy: IfNotPresent
image: hyperledger/fabric-peer:x86_64-1.0.0
workingDir: /opt/gopath/src/github.com/hyperledger/fabric/peer
volumeMounts:
- mountPath: /etc/hyperledger/fabric
name: fabric-vol
- mountPath: /etc/hyperledger/fabric/msp
name: fabric-vol-msp
- mountPath: /etc/hyperledger/fabric/tls
name: fabric-vol-tls
- mountPath: /var/run/docker.sock
name: docker-sock
env:
- name: CORE_VM_ENDPOINT
value: unix:///var/run/docker.sock
- name: CORE_PEER_ID
value: "peer0-org1"
- name: CORE_PEER_ADDRESS
value: "peer0-org1:7051"
- name: CORE_PEER_CHAINCODELISTENADDRESS
value: "peer0-org1:7052"
# - name: CORE_PEER_CHAINCODELISTENADDRESS
# value: "peer0-org1:7052"
- name: CORE_PEER_GOSSIP_EXTERNALENDPOINT
value: "peer0-org1:7051"
- name: CORE_PEER_GOSSIP_BOOTSTRAP
value: "peer0-org1:7051"
- name: CORE_PEER_LOCALMSPID
value: "Org1MSP"
- name: CORE_PEER_GOSSIP_ORGLEADER
value: "true"
- name: CORE_PEER_ADDRESSAUTODETECT
value: "false"
- name: CORE_LOGGING_LEVEL
value: "DEBUG"
Expand All @@ -49,18 +56,20 @@ spec:
value: "true"
- name: CORE_PEER_GOSSIP_ORGLEADER
value: "false"
- name: CORE_PEER_GOSSIP_SKIPHANDSHAKE
value: "true"
- name: CORE_PEER_PROFILE_ENABLED
value: "false"
value: "true"
- name: CORE_PEER_TLS_ENABLED
value: "false"
- 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
value: "/etc/hyperledger/fabric/tls/ca.crt"
ports:
- containerPort: 7050
#- containerPort: 7050
- containerPort: 7051
- containerPort: 7052
- containerPort: 7053
Expand All @@ -71,17 +80,22 @@ spec:
# - containerPort: 7058
# - containerPort: 7059
command:
# - /bin/bash
- peer
- node
- start
# command:
# - cat
# - "/etc/hyperledger/fabric/tls/server.crt"
# - /bin/bash
# - -nltpu
# - "7052"
volumes:
- name: fabric-vol
- name: fabric-vol-msp
hostPath:
path: /data/driving-files/fabric-peer/peer0-org1/msp
- name: fabric-vol-tls
hostPath:
path: /data/driving-files/fabric-peer/peer0-org1/tls
- name: docker-sock
hostPath:
path: /data/driving-files/fabric-peer/peer0-org1
path: /var/run/docker.sock
---
apiVersion: v1
kind: Service
Expand All @@ -92,9 +106,9 @@ metadata:
spec:
type: ClusterIP
ports:
- name: "7050"
targetPort: 7050
port: 7050
#- name: "7050"
# targetPort: 7050
# port: 7050
- name: "7051"
targetPort: 7051
port: 7051
Expand Down
57 changes: 39 additions & 18 deletions src/agent/k8s/manifests/fabric-1.0/local/peer1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,32 @@ spec:
restartPolicy: Always
containers:
- name: peer1-org1-container
imagePullPolicy: Never
image: hyperledger/fabric-peer:latest
imagePullPolicy: IfNotPresent
image: hyperledger/fabric-peer:x86_64-1.0.0
workingDir: /opt/gopath/src/github.com/hyperledger/fabric/peer
volumeMounts:
- mountPath: /etc/hyperledger/fabric
name: fabric-vol
- mountPath: /etc/hyperledger/fabric/msp
name: fabric-vol-msp
- mountPath: /etc/hyperledger/fabric/tls
name: fabric-vol-tls
- mountPath: /var/run/docker.sock
name: docker-sock
env:
- name: CORE_PEER_GOSSIP_BOOTSTRAP
value: "peer0-org1:7051"
- name: CORE_VM_ENDPOINT
value: unix:///var/run/docker.sock
- name: CORE_PEER_ID
value: "peer1-org1"
- name: CORE_PEER_ADDRESS
value: "peer1-org1:7051"
- name: CORE_PEER_CHAINCODELISTENADDRESS
value: "peer1-org1:7052"
# - name: CORE_PEER_CHAINCODELISTENADDRESS
# value: "peer1-org1:7052"
- name: CORE_PEER_GOSSIP_EXTERNALENDPOINT
value: "peer1-org1:7051"
- name: CORE_PEER_GOSSIP_BOOTSTRAP
value: "peer0-org1:7051"
- name: CORE_PEER_LOCALMSPID
value: "Org1MSP"
- name: CORE_PEER_GOSSIP_ORGLEADER
value: "true"
- name: CORE_PEER_ADDRESSAUTODETECT
value: "false"
- name: CORE_LOGGING_LEVEL
value: "DEBUG"
Expand All @@ -51,18 +56,20 @@ spec:
value: "true"
- name: CORE_PEER_GOSSIP_ORGLEADER
value: "false"
- name: CORE_PEER_GOSSIP_SKIPHANDSHAKE
value: "true"
- name: CORE_PEER_PROFILE_ENABLED
value: "false"
value: "true"
- name: CORE_PEER_TLS_ENABLED
value: "false"
- 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
value: "/etc/hyperledger/fabric/tls/ca.crt"
ports:
- containerPort: 7050
#- containerPort: 7050
- containerPort: 7051
- containerPort: 7052
- containerPort: 7053
Expand All @@ -73,13 +80,27 @@ spec:
# - containerPort: 7058
# - containerPort: 7059
command:
#- /bin/bash
#- sh
#- -c
#- "sleep 10; peer node start"
- peer
- node
- start
- --peer-defaultchain=false
#command:
#- cat
#- "/etc/hyperledger/fabric/tls/server.crt"
volumes:
- name: fabric-vol
- name: fabric-vol-msp
hostPath:
path: /data/driving-files/fabric-peer/peer1-org1/msp
- name: fabric-vol-tls
hostPath:
path: /data/driving-files/fabric-peer/peer1-org1/tls
- name: docker-sock
hostPath:
path: /data/driving-files/fabric-peer/peer1-org1
path: /var/run/docker.sock
---
apiVersion: v1
kind: Service
Expand All @@ -90,9 +111,9 @@ metadata:
spec:
type: ClusterIP
ports:
- name: "7050"
targetPort: 7050
port: 7050
#- name: "7050"
# targetPort: 7050
# port: 7050
- name: "7051"
targetPort: 7051
port: 7051
Expand Down
57 changes: 39 additions & 18 deletions src/agent/k8s/manifests/fabric-1.0/local/peer2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,32 @@ spec:
restartPolicy: Always
containers:
- name: peer0-org2-container
imagePullPolicy: Never
image: hyperledger/fabric-peer:latest
imagePullPolicy: IfNotPresent
image: hyperledger/fabric-peer:x86_64-1.0.0
workingDir: /opt/gopath/src/github.com/hyperledger/fabric/peer
volumeMounts:
- mountPath: /etc/hyperledger/fabric
name: fabric-vol
- mountPath: /etc/hyperledger/fabric/msp
name: fabric-vol-msp
- mountPath: /etc/hyperledger/fabric/tls
name: fabric-vol-tls
- mountPath: /var/run/docker.sock
name: docker-sock
env:
- name: CORE_PEER_GOSSIP_BOOTSTRAP
value: "peer0-org2:7051"
- name: CORE_VM_ENDPOINT
value: unix:///var/run/docker.sock
- name: CORE_PEER_ID
value: "peer0-org2"
- name: CORE_PEER_ADDRESS
value: "peer0-org2:7051"
- name: CORE_PEER_CHAINCODELISTENADDRESS
value: "peer0-org2:7052"
# - name: CORE_PEER_CHAINCODELISTENADDRESS
# value: "peer0-org2:7052"
- name: CORE_PEER_GOSSIP_EXTERNALENDPOINT
value: "peer1-org1:7051"
value: "peer0-org2:7051"
- name: CORE_PEER_GOSSIP_BOOTSTRAP
value: "peer0-org2:7051"
- name: CORE_PEER_LOCALMSPID
value: "Org2MSP"
- name: CORE_PEER_GOSSIP_ORGLEADER
value: "true"
- name: CORE_PEER_ADDRESSAUTODETECT
value: "false"
- name: CORE_LOGGING_LEVEL
value: "DEBUG"
Expand All @@ -51,8 +56,10 @@ spec:
value: "true"
- name: CORE_PEER_GOSSIP_ORGLEADER
value: "false"
- name: CORE_PEER_GOSSIP_SKIPHANDSHAKE
value: "true"
- name: CORE_PEER_PROFILE_ENABLED
value: "false"
value: "true"
- name: CORE_PEER_TLS_ENABLED
value: "false"
- name: CORE_PEER_TLS_CERT_FILE
Expand All @@ -62,7 +69,7 @@ spec:
- name: CORE_PEER_TLS_ROOTCERT_FILE
value: "/etc/hyperledger/fabric/tls/ca.crt"
ports:
- containerPort: 7050
#- containerPort: 7050
- containerPort: 7051
- containerPort: 7052
- containerPort: 7053
Expand All @@ -73,13 +80,27 @@ spec:
# - containerPort: 7058
# - containerPort: 7059
command:
#- /bin/bash
#- sh
#- -c
#- "sleep 10; peer node start"
- peer
- node
- start
- --peer-defaultchain=false
#command:
#- cat
#- "/etc/hyperledger/fabric/tls/server.crt"
volumes:
- name: fabric-vol
- name: fabric-vol-msp
hostPath:
path: /data/driving-files/fabric-peer/peer0-org2/msp
- name: fabric-vol-tls
hostPath:
path: /data/driving-files/fabric-peer/peer0-org2/tls
- name: docker-sock
hostPath:
path: /data/driving-files/fabric-peer/peer0-org2
path: /var/run/docker.sock
---
apiVersion: v1
kind: Service
Expand All @@ -90,9 +111,9 @@ metadata:
spec:
type: ClusterIP
ports:
- name: "7050"
targetPort: 7050
port: 7050
#- name: "7050"
# targetPort: 7050
# port: 7050
- name: "7051"
targetPort: 7051
port: 7051
Expand Down
Loading

0 comments on commit 01175c9

Please sign in to comment.