SCTP support in kubernetes v1.14.3, server/client not able to send/receive data packets via sctp

7/1/2019

We have a sctp java application (Server) running in a container (pod). We want to expose this sctp application to external networks(Client) using Nodeport. We are using latest Kubernetes 1.14.3 with docker version 18.06.

Java code for SERVER (running in pod) :

SocketAddress serverSocketAddress = new InetSocketAddress(30030); 
SctpServerChannel sctpServerChannel =  SctpServerChannel.open().bind(serverSocketAddress); 
SctpChannel sctpChannel; 
    while ((sctpChannel = sctpServerChannel.accept()) != null) 
{ 
            MessageInfo messageInfo = sctpChannel.receive(ByteBuffer.allocate(64000) , null, null); 
        }

config.yaml :

kind: ClusterConfiguration
kubernetesVersion: v1.14.3
networking:
  podSubnet: 192.168.0.0/16
apiServer:
  extraArgs:
     feature-gates: SCTPSupport=true

deployment yaml:

apiVersion: v1
kind: Service
metadata:
  name: sctpserver
  labels:
    app: testsctp
spec:
  ports:
    - name: sctpserver
      protocol: SCTP
      port: 30030
      targetPort: 'sctpserver'
      nodePort: 30030
  selector:
    app: testsctp
  type: NodePort
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: sctpserver
  labels:
    app: testsctp
spec:
  selector:
    matchLabels:
      app: testsctp
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: testsctp
    spec:
      containers:
      - image: sctpserver:latest
        imagePullPolicy: IfNotPresent
        name: sctpserver
        ports:
        - containerPort: 30030
          hostPort: 30030
          name: sctpserver
          protocol: SCTP

We see INIT (from external network) and INIT ACK (from kubernetes server) in wireshark but nothing more than that. The data packets are not getting forwarded from host to the container and vice versa.

Currently using Iptables but tried kube-proxy mode with ipvs in config file and result is still the same.

-- dhanush
java
kubernetes
sctp

0 Answers