Hyperledger Fabric on Kubernetes with ingress

4/24/2019

I am using AKS(Azure Kubernetes Service) to spin up all the Hyperledger Fabric containers. A sample Fabric network is running successfully on AKS. But, as by default all the containers/pods are accessible just within the cluster.

How do I use ingress to expose the pods/fabric containers to be accessible with external IPs?

I looked at some references but they use ingress-controller to define routes for navigating the request to a specific pod.

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: hello-world-ingress
  namespace: ingress-basic
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/ssl-redirect: "false"
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - http:
      paths:
      - path: /
        backend:
          serviceName: aks-helloworld
          servicePort: 80
      - path: /hello-world-two
        backend:
          serviceName: ingress-demo
          servicePort: 80

Whereas, we can't have any specific rules/path for peers/orderer containers.

Would be great if someone can point me towards the required configuration for it.

-- Nitish Bhardwaj
hyperledger-fabric
kubernetes
kubernetes-ingress
nginx-ingress

1 Answer

4/24/2019

First of all, Ingress define routes to services and not pods. If you have a LoadBalancer service for your Ingress-controller you should be able to expose your apps. Here are the installation instrutions.

P.S. You don't necessarily need a reverse proxy to expose your services externally. You can do it with NodePort services.

P.S.2 If you need more complex rules and requirements for routing, I strongly recommend checking out Ambassador.

-- victortv
Source: StackOverflow