Self hosted net.tcp wcf in a Kubernetes container access via Loadbalance IP of kuberenetes

597 Views Asked by At

I have self hosted a .NET framework 4.x version of WCF with net.tcp binding console app, which is running in Azure k8s contianer, as a selfhosted wcf service

exposed as net.tcp://CONTAINERIP:5000/WCFServiceName

and the port 5000 is exposed via Loadbalancer type ingress service

so the client will be accessing this service like below

net.tcp://LoadBalancerIP:5000/containerAppName/WCFServiceName

But using the loadbalancer ip is not forwarding the request to container - getting the error.

'There was no endpoint listening at net.tcp://LoadBalancerIp:5000/ContainerAppName/WCFServiceName that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.'

LB Yaml

spec:
  clusterIP: IP.ADDRESS.OF.CLUSTER
  externalTrafficPolicy: Cluster
  ports:
  - name: nettcp
    nodePort: 30412
    port: 5000
    protocol: TCP
    targetPort: 5000
  selector:
    app: CONTAINERAPPNAME
  sessionAffinity: None
  type: LoadBalancer
status:
  loadBalancer:
    ingress:
    - ip: LB.PUBLIC.IP.ADDRESS

Any idea or suggesions ??

1

There are 1 best solutions below

0
solairaja On

Guys thanks for the inputs,

Found the reason for the issue, since the app is deployed using the LoadBalancer type service, its not required to provide APP Name in the URL.

when the outside world access the service :

net.tcp://LoadBalancerIP:5000/containerAppName/WCFServiceName - WONT WORK

net.tcp://LoadBalancerIP:5000/WCFServiceName - THIS WORKS !!! (Solution)

or

when we do the self hosting we need to include the app name in the URI framing to host the WCF TCP Service.