I am trying to set up Hyperledger fabric with kubernetes(1 Master & 1 Minion) Wavenet network configuration.
Kubernetes Version : 1.13.3 Ubuntu Version : 18.04 (bionic)
Below is my deployment and service for orderer .
apiVersion: apps/v1
kind: Deployment
metadata:
name: orderer
spec:
replicas: 1
selector:
matchLabels:
app: orderer
template:
metadata:
labels:
app: orderer
spec:
hostname: orderer-example-com
volumes:
- name: nfs-volume
nfs:
server: 13.71.xx.xx
path: /home/
containers:
- args:
- orderer
env:
- name: ORDERER_GENERAL_GENESISFILE
value: /home/channel/genesis.block
- name: ORDERER_GENERAL_GENESISMETHOD
value: file
- name: ORDERER_GENERAL_LEDGERTYPE
value: json
- name: ORDERER_GENERAL_LISTENADDRESS
value: 127.0.0.1
- name: ORDERER_GENERAL_LISTENPORT
value: "7050"
- name: ORDERER_GENERAL_LOCALMSPDIR
value: "/home/crypto/crypto-config/ordererOrganizations/insurance.com/orderers/orderer.insurance.com/msp"
- name: ORDERER_GENERAL_LOCALMSPID
value: OrdererMSP
- name: ORDERER_GENERAL_LOGLEVEL
value: info
- name: ORDERER_GENERAL_TLS_CERTIFICATE
value: /home/crypto/crypto-config/ordererOrganizations/insurance.com/orderers/orderer.insurance.com/tls/server.crt
- name: ORDERER_GENERAL_TLS_ENABLED
value: "false"
- name: ORDERER_GENERAL_TLS_PRIVATEKEY
value: /home/crypto/crypto-config/ordererOrganizations/insurance.com/orderers/orderer.insurance.com/tls/server.key
- name: ORDERER_GENERAL_TLS_ROOTCAS
value: '[/home/crypto/crypto-config/ordererOrganizations/insurance.com/orderers/orderer.insurance.com/tls/ca.crt]'
image: hyperledger/fabric-orderer
name: orderer
ports:
- name: orderer-port
containerPort: 7050
resources: {}
volumeMounts:
- mountPath: "/home/"
name: nfs-volume
# - mountPath: "/home/channel"
# name: orderer-insurance-com-claim0
# - mountPath: "/home/crypto/crypto-config/ordererOrganizations/insurance.com/orderers/orderer.insurance.com"
# name: orderer-insurance-com-claim1
workingDir: /opt/gopath/src/github.com/hyperledger/fabric/orderer
restartPolicy: Always
-----
apiVersion: v1
kind: Service
metadata:
name: orderer
spec:
selector:
app: orderer
ports:
- protocol: TCP
targetPort: 7050
port: 7050
nodePort: 31001
name: orderer-port
type: NodePort
I have exposed the port 7050 of orderer deployment as a service to the port 31001. The Orderer pod seems to run fine and there is no error in the pod or service. Strangely when i try to connect the orderer service it always timeout.
I did check the service and it does exposes the port i.e 7050-->310001. Not sure why I get timeout .
curl "localhost:31001" also timesout .
Can you please let me know If i am missing anything with kubernetes ?
**Update : Orderer Pod description
I don't think
- name: ORDERER_GENERAL_LISTENADDRESS
value: 127.0.0.1
will work as this means the orderer is only listening in the loopback address inside the container. Try setting the value to 0.0.0.0
.