feat: add support for SCTP#2007
Conversation
53e993a to
d0b7207
Compare
77752f3 to
f9da93b
Compare
|
@damex I've just started testing this one, I may need a bit longer on this one depending on how the testing goes. |
aauren
left a comment
There was a problem hiding this comment.
Hey @damex when I tried testing this I wasn't able to get an sctp client to talk to an sctp server via a service.
I did notice an error in the kube-router logs:
2026-03-09T02:05:37.779401362Z E0309 02:05:37.779285 19477 service_endpoints_sync.go:92] Error syncing ipvs svc iptables rules to permit traffic to service VIP's: could not save ipset for service firewall: ipset v7.24: Error in line 27: Syntax error: cannot parse 'sctp' as a protocol
This was performed on a host running: Ubuntu 24.04.4 LTS
I applied the following for an SCTP server:
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: sctp-server
spec:
replicas: 2
selector:
matchLabels:
app: sctp-server
template:
metadata:
labels:
app: sctp-server
spec:
containers:
- name: sctp-server
image: alpine
command: ["/bin/sh", "-c"]
args: ["apk add lksctp-tools && sctp_test -H 0.0.0.0 -P 36412 -l"]
ports:
- containerPort: 36412
protocol: SCTP
---
apiVersion: v1
kind: Service
metadata:
name: sctp-service
spec:
selector:
app: sctp-server
ports:
- port: 36412
targetPort: 36412
protocol: SCTP
type: ClusterIPAnd then for the client I ran:
kubectl run sctp-client --rm -it --image=alpine -- sh
# apk add lksctp-tools
# sctp_test -H 0.0.0.0 -P 0 -h <cluster_ip_from_above> -p 36412 -s
Maybe you could look into this a little deeper?
|
looks like error from alpine side, right? http://git.musl-libc.org/cgit/musl/tree/src/network/proto.c looks like they don't use /etc/protocols and just hardcode those. i think either patch musl (patch upstream)... or... would it be acceptable to do protocol by name -> numeric value mapping here? on a side note - do you think we could add some 'test' so this type of error could be caught next time? simple check with alpine and here is the ubuntu |
|
Interesting! Yeah I can confirm that I was using the official kube-router which is based on Alpine and seems to confirm what you found. I would say using the integer mapping should be good enough to make it work everywhere for now and maybe get around the musl quirks. I can't think of a unit test that would test for this and this repo doesn't really do integration tests for now (although it has been something that @catherinetcai has been thinking about). |
includes workaround for musl hardcoded protocol table that is missing SCTP support by using protocol name to numeric value mapping in ipset entries closes: cloudnativelabs#1019 Signed-off-by: Roman Kuzmitskii <roman@damex.org>
f9da93b to
fe1aff7
Compare
|
@aauren added exception/workaround for SCTP ipset handling. well, i can also try to send patch to musl to include 'sctp support' so we could drop this workaround :) |
aauren
left a comment
There was a problem hiding this comment.
This LGTM thanks for the contribution and for the updates!
I'm sure that musl would appreciate the protocol contribution if you're interested in making it! It seems like a neat project to be a contributor to. 🙂
No description provided.