Skip to content

Commit 806e334

Browse files
committed
Propose KEP 1860 as implementable
Signed-off-by: Patrik Cyvoct <[email protected]>
1 parent 4f390cb commit 806e334

File tree

2 files changed

+71
-18
lines changed

2 files changed

+71
-18
lines changed

keps/sig-network/1860-kube-proxy-IP-node-binding/README.md

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,20 @@
1616
- [Risks and Mitigations](#risks-and-mitigations)
1717
- [Drawbacks](#drawbacks)
1818
- [Alternatives](#alternatives)
19+
- [Design Details](#design-details)
20+
- [Test Plan](#test-plan)
21+
- [Graduation Criteria](#graduation-criteria)
1922
<!-- /toc -->
2023

2124
## Release Signoff Checklist
2225

2326
Items marked with (R) are required *prior to targeting to a milestone / release*.
2427

25-
- [ ] (R) Enhancement issue in release milestone, which links to KEP dir in [kubernetes/enhancements] (not the initial KEP PR)
26-
- [ ] (R) KEP approvers have approved the KEP status as `implementable`
27-
- [ ] (R) Design details are appropriately documented
28-
- [ ] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input
29-
- [ ] (R) Graduation criteria is in place
28+
- [x] (R) Enhancement issue in release milestone, which links to KEP dir in [kubernetes/enhancements] (not the initial KEP PR)
29+
- [x] (R) KEP approvers have approved the KEP status as `implementable`
30+
- [x] (R) Design details are appropriately documented
31+
- [x] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input
32+
- [x] (R) Graduation criteria is in place
3033
- [ ] (R) Production readiness review completed
3134
- [ ] Production readiness review approved
3235
- [ ] "Implementation History" section is up-to-date for milestone
@@ -66,31 +69,31 @@ Currently there is some hacky workaround that set the `Hostname` on the `Service
6669

6770
## Proposal
6871

69-
The solution would be to add a new field in the `loadBalancer` field of a `Service`'s `status`, like `ingressMode`. This new field will be used by kube-proxy in order to not bind the Load Balancer's External IP to the node (in both IPVS and iptables mode). The value `VIP` would be the default one (if not set for instance), keeping the current behaviour. The value `Proxy` would be used in order to disable the the shortcut.
72+
The solution would be to add a new field in the `loadBalancer` field of a `Service`'s `status`, like `ipMode`. This new field will be used by kube-proxy in order to not bind the Load Balancer's External IP to the node (in both IPVS and iptables mode). The value `VIP` would be the default one (if not set for instance), keeping the current behaviour. The value `Proxy` would be used in order to disable the the shortcut.
7073

71-
Since the `EnsureLoadBalancer` returns a `LoadBalancerStatus`, the Cloud Controller Manager can optionally set the `ingressMode` field before returning the status.
74+
Since the `EnsureLoadBalancer` returns a `LoadBalancerStatus`, the Cloud Controller Manager can optionally set the `ipMode` field before returning the status.
7275

7376
### User Stories
7477

7578
#### Story 1
7679

77-
User 1 is a Managed Kubernetes user. There cluster is running on a cloud provider where the LB's behaviour matches the `VIP` `ingressMode`.
80+
User 1 is a Managed Kubernetes user. There cluster is running on a cloud provider where the LB's behaviour matches the `VIP` `ipMode`.
7881
Nothing changes for them since the cloud provider manages the Cloud Controller Manager.
7982

8083
#### Story 2
8184

82-
User 2 is a Managed Kubernetes user. There cluster is running on a cloud provider where the LB's behaviour matches the `Proxy` `ingressMode`.
85+
User 2 is a Managed Kubernetes user. There cluster is running on a cloud provider where the LB's behaviour matches the `Proxy` `ipMode`.
8386
Almost nothing changes for them since the cloud provider manages the Cloud Controller Manager.
8487
The only difference is that pods using the load balancer IP may observe a higher response time since the datapath will go through the load balancer.
8588

8689
#### Story 3
8790

8891
User 3 is a developer working on a cloud provider Kubernetes offering.
89-
On the next version of `k8s.io/cloud-provider`, the cloud provider can optionally set the `ingressMode` field as part of `LoadBalancerStatus`, and reflect the cloud provider load balancer behaviour.
92+
On the next version of `k8s.io/cloud-provider`, the cloud provider can optionally set the `ipMode` field as part of `LoadBalancerStatus`, and reflect the cloud provider load balancer behaviour.
9093

9194
### Risks and Mitigations
9295

93-
1. The first risk is when using the `Proxy` `ingressMode` for pod using the load balancer IP. In this case the packets will not bypass the load balancer anymore.
96+
1. The first risk is when using the `Proxy` `ipMode` for pod using the load balancer IP. In this case the packets will not bypass the load balancer anymore.
9497
However if a user wants to to keep using the in cluster datapath, he can still use the ClusterIP of the service.
9598

9699
## Drawbacks
@@ -102,3 +105,43 @@ However if a user wants to to keep using the in cluster datapath, he can still u
102105
A viable alternative may be to use a flag directly on `kube-proxy`.
103106
When running on a cloud provider managed Kubernetes this solution is viable since the cloud provider will be able to set the right value on `kube-proxy`.
104107
When running a self hosted cluster, the user needs to be aware of how the cloud's load balancers works and need to set the flag on `kube-proxy` accordingly.
108+
109+
## Design Details
110+
111+
API changes to Service:
112+
- Add a new field `status.loadBalancer.ingress[].ipMode: VIP | Proxy`.
113+
- `ipMode` defaults to VIP if the feature gate is enabled, `nil` otherwise, preserving existing behaviour for Service Type=LoadBalancer.
114+
- On create and update, it fails if `ipMode` is set without the `ip` field.
115+
116+
## Test Plan
117+
118+
Unit tests:
119+
- unit tests for the ipvs and iptables rules
120+
- unit tests for the validation
121+
- unit tests for a new util in pkg/proxy
122+
123+
E2E tests:
124+
- The default behavior for `ipMode` does not break any existing e2e tests
125+
- The default `VIP` value is already tested
126+
127+
## Graduation Criteria
128+
129+
### Alpha
130+
131+
Adds new field `ipMode` to Service, which is used when `LoadBalancerIPMode` feature gate is enabled, allowing for rollback.
132+
133+
### Beta/GA
134+
135+
`LoadBalancerIPMode` is enabled by default.
136+
137+
### Upgrade / Downgrade Strategy
138+
139+
On upgrade, while the feature gate is disabled, nothing will change. Once the feature gate is enabled, all the previous LoadBalancer service will get an `ipMode` of `VIP`.
140+
If `kube-proxy` was not yet upgraded: the field will simply be ignored.
141+
If `kube-proxy` was upgraded, and the feature gate enabled, it will stil behave as before if the `ipMode` is `VIP`, and will behave accordingly if the `ipMode` is `Proxy`.
142+
143+
On downgrade, the feature gate will simply be disabled, and as long as `kube-proxy` was downgraded before, nothing should be impacted.
144+
145+
### Version Skew Strategy
146+
147+
Version skew from the control plane to `kube-proxy` should be trivial since `kube-proxy` will simply ignore the `ipMode` field.

keps/sig-network/1860-kube-proxy-IP-node-binding/kep.yaml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,27 @@ authors:
55
owning-sig: sig-network
66
participating-sigs:
77
- sig-cloud-provider
8+
status: implementable
89
reviewers:
910
- "@thockin"
1011
- "@cheftako"
1112
- "@MorrisLaw"
1213
approvers:
1314
- "@thockin"
1415
- "@andrewsykim"
15-
editor: "@Sh4d1"
16-
creation-date: 2019-12-05
17-
last-updated: 2020-06-18
18-
status: provisional
19-
replaces:
20-
superseded-by:
21-
see-also:
16+
17+
stage: "alpha"
18+
19+
latest-milestone: "v1.21"
20+
21+
milestone:
22+
alpha: "v1.21"
23+
beta: "v1.22"
24+
stable: "v1.22"
25+
26+
feature-gates:
27+
- name: LoadBalancerIPMode
28+
components:
29+
- kube-apiserver
30+
- kube-proxy
31+
disable-supported: true

0 commit comments

Comments
 (0)