Skip to content

Commit 37ee1e3

Browse files
committed
Remove references to kube-proxy userspace mode
1 parent 98973fd commit 37ee1e3

File tree

3 files changed

+5
-103
lines changed

3 files changed

+5
-103
lines changed

content/en/docs/reference/networking/service-protocols.md

-5
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ The support of multihomed SCTP associations requires that the CNI plugin can sup
4646

4747
NAT for multihomed SCTP associations requires special logic in the corresponding kernel modules.
4848

49-
{{< note >}}
50-
The kube-proxy does not support the management of SCTP associations when it is in userspace mode.
51-
{{< /note >}}
52-
53-
5449
### `TCP` {#protocol-tcp}
5550

5651
You can use TCP for any kind of Service, and it's the default network protocol.

content/en/docs/reference/networking/virtual-ips.md

+4-63
Original file line numberDiff line numberDiff line change
@@ -61,63 +61,6 @@ Note that the kube-proxy starts up in different modes, which are determined by i
6161
- The ConfigMap parameters for the kube-proxy cannot all be validated and verified on startup.
6262
For example, if your operating system doesn't allow you to run iptables commands,
6363
the standard kernel kube-proxy implementation will not work.
64-
Likewise, if you have an operating system which doesn't support `netsh`,
65-
it will not run in Windows userspace mode.
66-
67-
### User space proxy mode {#proxy-mode-userspace}
68-
69-
{{< feature-state for_k8s_version="v1.23" state="deprecated" >}}
70-
71-
This (legacy) mode uses iptables to install interception rules, and then performs
72-
traffic forwarding with the assistance of the kube-proxy tool.
73-
The kube-procy watches the Kubernetes control plane for the addition, modification
74-
and removal of Service and EndpointSlice objects. For each Service, the kube-proxy
75-
opens a port (randomly chosen) on the local node. Any connections to this _proxy port_
76-
are proxied to one of the Service's backend Pods (as reported via
77-
EndpointSlices). The kube-proxy takes the `sessionAffinity` setting of the Service into
78-
account when deciding which backend Pod to use.
79-
80-
The user-space proxy installs iptables rules which capture traffic to the
81-
Service's `clusterIP` (which is virtual) and `port`. Those rules redirect that traffic
82-
to the proxy port which proxies the backend Pod.
83-
84-
By default, kube-proxy in userspace mode chooses a backend via a round-robin algorithm.
85-
86-
{{< figure src="/images/docs/services-userspace-overview.svg" title="Services overview diagram for userspace proxy" class="diagram-medium" >}}
87-
88-
89-
#### Example {#packet-processing-userspace}
90-
91-
As an example, consider the image processing application described [earlier](#example)
92-
in the page.
93-
When the backend Service is created, the Kubernetes control plane assigns a virtual
94-
IP address, for example 10.0.0.1. Assuming the Service port is 1234, the
95-
Service is observed by all of the kube-proxy instances in the cluster.
96-
When a proxy sees a new Service, it opens a new random port, establishes an
97-
iptables redirect from the virtual IP address to this new port, and starts accepting
98-
connections on it.
99-
100-
When a client connects to the Service's virtual IP address, the iptables
101-
rule kicks in, and redirects the packets to the proxy's own port.
102-
The "Service proxy" chooses a backend, and starts proxying traffic from the client to the backend.
103-
104-
This means that Service owners can choose any port they want without risk of
105-
collision. Clients can connect to an IP and port, without being aware
106-
of which Pods they are actually accessing.
107-
108-
#### Scaling challenges {#scaling-challenges-userspace}
109-
110-
Using the userspace proxy for VIPs works at small to medium scale, but will
111-
not scale to very large clusters with thousands of Services. The
112-
[original design proposal for portals](https://github.com/kubernetes/kubernetes/issues/1107)
113-
has more details on this.
114-
115-
Using the userspace proxy obscures the source IP address of a packet accessing
116-
a Service.
117-
This makes some kinds of network filtering (firewalling) impossible. The iptables
118-
proxy mode does not
119-
obscure in-cluster source IPs, but it does still impact clients coming through
120-
a load balancer or node-port.
12164

12265
### `iptables` proxy mode {#proxy-mode-iptables}
12366

@@ -135,7 +78,7 @@ is handled by Linux netfilter without the need to switch between userspace and t
13578
kernel space. This approach is also likely to be more reliable.
13679

13780
If kube-proxy is running in iptables mode and the first Pod that's selected
138-
does not respond, the connection fails. This is different from userspace
81+
does not respond, the connection fails. This is different from the old `userspace`
13982
mode: in that scenario, kube-proxy would detect that the connection to the first
14083
Pod had failed and would automatically retry with a different backend Pod.
14184

@@ -148,7 +91,8 @@ having traffic sent via kube-proxy to a Pod that's known to have failed.
14891

14992
#### Example {#packet-processing-iptables}
15093

151-
Again, consider the image processing application described [earlier](#example).
94+
As an example, consider the image processing application described [earlier](#example)
95+
in the page.
15296
When the backend Service is created, the Kubernetes control plane assigns a virtual
15397
IP address, for example 10.0.0.1. For this example, assume that the
15498
Service port is 1234.
@@ -162,10 +106,7 @@ endpoint rules redirect traffic (using destination NAT) to the backends.
162106

163107
When a client connects to the Service's virtual IP address the iptables rule kicks in.
164108
A backend is chosen (either based on session affinity or randomly) and packets are
165-
redirected to the backend. Unlike the userspace proxy, packets are never
166-
copied to userspace, the kube-proxy does not have to be running for the virtual
167-
IP address to work, and Nodes see traffic arriving from the unaltered client IP
168-
address.
109+
redirected to the backend without rewriting the client IP address.
169110

170111
This same basic flow executes when traffic comes in through a node-port or
171112
through a load-balancer, though in those cases the client IP address does get altered.

content/en/docs/tasks/debug/debug-application/debug-service.md

+1-35
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,6 @@ should see something like:
527527
```none
528528
I1027 22:14:53.995134 5063 server.go:200] Running in resource-only container "/kube-proxy"
529529
I1027 22:14:53.998163 5063 server.go:247] Using iptables Proxier.
530-
I1027 22:14:53.999055 5063 server.go:255] Tearing down userspace rules. Errors here are acceptable.
531530
I1027 22:14:54.038140 5063 proxier.go:352] Setting endpoints for "kube-system/kube-dns:dns-tcp" to [10.244.1.3:53]
532531
I1027 22:14:54.038164 5063 proxier.go:352] Setting endpoints for "kube-system/kube-dns:dns" to [10.244.1.3:53]
533532
I1027 22:14:54.038209 5063 proxier.go:352] Setting endpoints for "default/kubernetes:https" to [10.240.0.2:443]
@@ -549,8 +548,7 @@ and then retry.
549548

550549
Kube-proxy can run in one of a few modes. In the log listed above, the
551550
line `Using iptables Proxier` indicates that kube-proxy is running in
552-
"iptables" mode. The most common other mode is "ipvs". The older "userspace"
553-
mode has largely been replaced by these.
551+
"iptables" mode. The most common other mode is "ipvs".
554552

555553
#### Iptables mode
556554

@@ -602,24 +600,6 @@ endpoint, it will create corresponding real servers. In this example, service
602600
hostnames(`10.0.1.175:80`) has 3 endpoints(`10.244.0.5:9376`,
603601
`10.244.0.6:9376`, `10.244.0.7:9376`).
604602

605-
#### Userspace mode
606-
607-
In rare cases, you may be using "userspace" mode. From your Node:
608-
609-
```shell
610-
iptables-save | grep hostnames
611-
```
612-
```none
613-
-A KUBE-PORTALS-CONTAINER -d 10.0.1.175/32 -p tcp -m comment --comment "default/hostnames:default" -m tcp --dport 80 -j REDIRECT --to-ports 48577
614-
-A KUBE-PORTALS-HOST -d 10.0.1.175/32 -p tcp -m comment --comment "default/hostnames:default" -m tcp --dport 80 -j DNAT --to-destination 10.240.115.247:48577
615-
```
616-
617-
There should be 2 rules for each port of your Service (only one in this
618-
example) - a "KUBE-PORTALS-CONTAINER" and a "KUBE-PORTALS-HOST".
619-
620-
Almost nobody should be using the "userspace" mode any more, so you won't spend
621-
more time on it here.
622-
623603
### Is kube-proxy proxying?
624604

625605
Assuming you do see one the above cases, try again to access your Service by
@@ -632,20 +612,6 @@ curl 10.0.1.175:80
632612
hostnames-632524106-bbpiw
633613
```
634614

635-
If this fails and you are using the userspace proxy, you can try accessing the
636-
proxy directly. If you are using the iptables proxy, skip this section.
637-
638-
Look back at the `iptables-save` output above, and extract the
639-
port number that `kube-proxy` is using for your Service. In the above
640-
examples it is "48577". Now connect to that:
641-
642-
```shell
643-
curl localhost:48577
644-
```
645-
```none
646-
hostnames-632524106-tlaok
647-
```
648-
649615
If this still fails, look at the `kube-proxy` logs for specific lines like:
650616

651617
```none

0 commit comments

Comments
 (0)