When we are developing cloud services, we will need SCTP sometimes, but we don’t have SCTP enabled on kubernetes in default, this tutorial go through with how to boot a kubernetes cluster with SCTP enabled, and onboard a SCTP server for testing.
- OS: Ubuntu 18.04 LTS
- Kubernetes: 1.13.1
Here comes a example of how to write a
Service with SCTP. Also, you can find a example helm-chart at here: aweimeow/sctp-server, this example packed StackOverflow - Python SCTP Server Side Module‘s source code into the container image.
If we are going to make kubernetes support with SCTP, we can use
SCTPSupport=true to enable SCTP function in cluster. And I set the networking parameters in the sametime,
networking/podSubnet corresponds to
--pod-network-cidr parameter when we boot the cluster by arguments.
And using this command to start cluster by assigning configuration file, you can join other nodes into this cluster by command’s output.
$ sudo kubeadm init --config config.yaml
First, we need to install tiller pod into this cluster, but you may need to have
tiller account have
cluster-admin privilege, so
helm can use User
tiller to deploy services and pods on this cluster.
Then you can install
tiller pod on cluster, and deploy chart to this cluster.
$ helm init --service-account tiller
First of all, let us check our service is deployed successfully.
[email protected]:~$ kubectl -n sctp get services
Because our pod is deployed on
node2, so we can verify SCTP by following command:
[email protected]:~$ ncat --sctp node2 30001
You can also check SCTP traffic by
[email protected]:~$ sudo tcpdump -env sctp