From 20c3b985b71af5cf2b03b751bf0dda925d7de482 Mon Sep 17 00:00:00 2001 From: Laszlo Janosi Date: Fri, 15 Jun 2018 09:26:26 +0000 Subject: New KEP document at keps/sig-network/0015-20180614-SCTP-support.md --- keps/sig-network/0015-20180614-SCTP-support.md | 291 +++++++++++++++++++++++++ 1 file changed, 291 insertions(+) create mode 100644 keps/sig-network/0015-20180614-SCTP-support.md diff --git a/keps/sig-network/0015-20180614-SCTP-support.md b/keps/sig-network/0015-20180614-SCTP-support.md new file mode 100644 index 00000000..ef3ac678 --- /dev/null +++ b/keps/sig-network/0015-20180614-SCTP-support.md @@ -0,0 +1,291 @@ +--- +kep-number: 15 +title: SCTP support +authors: + - "@janosi" +owning-sig: sig-network +participating-sigs: + - sig-cloud-provider +reviewers: + - "@thockin" +approvers: + - TBD +editor: TBD +creation-date: 2018-06-14 +last-updated: yyyy-mm-dd +status: provisional +see-also: + - PR64973 +replaces: +superseded-by: +--- + +# SCTP support + +## Table of Contents + +* [Table of Contents](#table-of-contents) +* [Summary](#summary) +* [Motivation](#motivation) + * [Goals](#goals) + * [Non-Goals](#non-goals) +* [Proposal](#proposal) + * [User Stories [optional]](#user-stories-optional) + * [Story 1](#story-1) + * [Story 2](#story-2) + * [Implementation Details/Notes/Constraints [optional]](#implementation-detailsnotesconstraints-optional) + * [Risks and Mitigations](#risks-and-mitigations) +* [Graduation Criteria](#graduation-criteria) +* [Implementation History](#implementation-history) +* [Drawbacks [optional]](#drawbacks-optional) +* [Alternatives [optional]](#alternatives-optional) + +[Tools for generating]: https://github.com/ekalinin/github-markdown-toc + +## Summary + +The goal of the SCTP support feature is to enable the usage of the SCTP protocol in Kubernetes [Service][] and [NetworkPolicy][] as an additional protocol option beside the current TCP and UDP options. +SCTP is an IETF protocol specified in [RFC4960][], and it is used widely in telecommunications network stacks. +Once SCTP support is added as a new protocol option for Service and NetworkPolicy those applications that require SCTP as L4 protocol on their interfaces can be deployed on Kubernetes clusters on a more straightforward way. For example they can use the native kube-dns based service discovery, and their communication can be controlled on the native NetworkPolicy way. + + + +[Service]: https://kubernetes.io/docs/concepts/services-networking/service/ +[NetworkPolicy]: https://kubernetes.io/docs/concepts/services-networking/network-policies/ +[RFC4960]: https://tools.ietf.org/html/rfc4960 + +## Motivation + +SCTP is a widely used protocol in telecommunications. It would ease the management and execution of telecommunication applications on Kubernetes if SCTP were added as a protocol option to Kubernetes Service and NetworkPolicy. + + +### Goals + +Add SCTP support to Kubernetes Service and NetworkPolicy, so applications running in pods can use the native kube-dns based service discovery for SCTP based services, and their communication can be controlled via the native NetworkPolicy way. + + + +### Non-Goals + +It is not a goal here to add SCTP support to load balancers that are provided by cloud providers. I.e. the Kubernetes user can define Services with type=LoadBalancer and Protocol=SCTP, but if the actual load balancer implementation does not support SCTP then the creation of the Service/load balancer fails. + + +## Proposal + + +### User Stories [optional] + + +#### Service with SCTP and Virtual IP +As a user of Kubernetes I want to define Services with Virtual IPs for my applications that use SCTP as L4 protocol on their interfaces,so client applications can use the services of my applications on top of SCTP via that Virtual IP. +Example: +``` +kind: Service +apiVersion: v1 +metadata: + name: my-service +spec: + selector: + app: MyApp + ports: + - protocol: SCTP + port: 80 + targetPort: 9376 +``` + +#### Headless Service with SCTP +As a user of Kubernetes I want to define headless Services for my applications that use SCTP as L4 protocol on their interfaces, so client applications can discover my applications in kube-dns, or via any other service discovery method that gets information about endpoints via the Kubernetes API. +Example: +``` +kind: Service +apiVersion: v1 +metadata: + name: my-service +spec: + selector: + app: MyApp + ClusterIP: "None" + ports: + - protocol: TCP + port: 80 + targetPort: 9376 +``` +#### Service with SCTP without selector +As a user of Kubernetes I want to define Services without selector for my applications that use SCTP as L4 protocol on their interfaces,so I can implement my own service controllers if I want to extend the basic functionality of Kubernetes. +Example: +``` +kind: Service +apiVersion: v1 +metadata: + name: my-service +spec: + ClusterIP: "None" + ports: + - protocol: TCP + port: 80 + targetPort: 9376 +``` +#### NetworkPolicy with SCTP +As a user of Kubernetes I want to define NetworPolicies for my applications that use SCTP as L4 protocol on their interfaces, so the network controllers that support SCTP can control the accessibility of my applications on the SCTP based interfaces, too. +Example: +``` +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: myservice-network-policy + namespace: myapp +spec: + podSelector: + matchLabels: + role: myservice + policyTypes: + - Ingress + - Egress + ingress: + - from: + - ipBlock: + cidr: 172.17.0.0/16 + except: + - 172.17.1.0/24 + - namespaceSelector: + matchLabels: + project: myproject + - podSelector: + matchLabels: + role: myclient + ports: + - protocol: SCTP + port: 7777 +``` +#### User space SCTP stack +As a user of Kubernetes I want to deploy and run my applications that use a user space SCTP stack. + +### Implementation Details/Notes/Constraints [optional] + + +#### SCTP in Services +The Kubernetes API modification for Services is obvious. +The selected port shall be reserved on the node, just like for TCP and UDP now. Unfortunately, golang does not have native SCTP support in the "net" package, so in order to access the kernel's SCTP API we have to introduce a new 3rd party package as a new vendor package. +For Services with type=LoadBalancer we have to check how the cloud provider implementations handle new protocols, and we have to make sure that if SCTP is not supported then the request for a new load balancer, firewall rule, etc. with protocol=SCTP is rejected gracefully. + +#### SCTP in NetworkPolicy +The Kubernetes API modification for the NetworkPolicy is obvious. +In order to utilize the new protocol value the network controller must support it. + +#### Interworking with applications that use a user space SCTP stack +A userspace SCTP stack implementation cannot work together with the SCTP kernel module (lksctp) on the same node. That is, the loading of the SCTP kernel module must be avoided on nodes where such applications that use userspace SCTP stack are planned to be run. The problem comes with the introduction of the SCTP protocol option for Services with Virtual IP: once such a service is created the relevant iptables/ipvs management logic kicks-in on every node, and as a consequence it loads the SCTP kernel module. There are some ideas how to solve this interworking problem: + +1. "-p sctp" is not used in the iptables rules, the processing of requests to the Virtual IP is executed purely based on the destination IP address and port. In case of ipvs the protocol is a mandatory parameter, so ipvs with SCTP rules cannot be used on the node where userspace SCTP applications should run. +2. Fall back to the user space proxy on those specific nodes. The user space proxy shall also use a user space SCTP stack, of course. Also the iptables rules that direct the client traffic to the userspace proxy must be created without the "-p sctp" option. + +In any case we shall be able to dedicate these nodes for those userspace SCTP applications, or at least, we must achieve that "regular" SCTP user applications are not deployed on these nodes. The solution proposal for this node separation: + +- there shall be a new kube-proxy parameter. If the parameter is set, the kube-proxy switches to this new mode of operation (described above) for SCTP services +- if the new kube-proxy parameter is set the node must be tainted with a new taint, so the scheduler places only such SCTP applications on this node that use userspace SCTP stack. We must avoid the deployment of "regular" SCTP users on this node. + +### Risks and Mitigations + + +## Graduation Criteria + + +## Implementation History + + +## Drawbacks [optional] + + +## Alternatives [optional] + + \ No newline at end of file -- cgit v1.2.3