Skip to content

Commit 07d187a

Browse files
authored
Merge pull request #42568 from windsonsea/mixedv
Clean up mixed-version-proxy.md and nodes.md
2 parents 3cfecaa + aa696ee commit 07d187a

File tree

2 files changed

+89
-65
lines changed

2 files changed

+89
-65
lines changed

content/en/docs/concepts/architecture/mixed-version-proxy.md

Lines changed: 45 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,25 @@ weight: 220
77
---
88

99
<!-- overview -->
10-
{{< feature-state state="alpha" for_k8s_version="v1.28" >}}
1110

12-
Kubernetes {{< skew currentVersion >}} includes an alpha feature that lets a
11+
{{< feature-state state="alpha" for_k8s_version="v1.28" >}}
12+
13+
Kubernetes {{< skew currentVersion >}} includes an alpha feature that lets an
1314
{{< glossary_tooltip text="API Server" term_id="kube-apiserver" >}}
1415
proxy a resource requests to other _peer_ API servers. This is useful when there are multiple
15-
API servers running different versions of Kubernetes in one cluster (for example, during a long-lived
16-
rollout to a new release of Kubernetes).
16+
API servers running different versions of Kubernetes in one cluster
17+
(for example, during a long-lived rollout to a new release of Kubernetes).
1718

1819
This enables cluster administrators to configure highly available clusters that can be upgraded
1920
more safely, by directing resource requests (made during the upgrade) to the correct kube-apiserver.
2021
That proxying prevents users from seeing unexpected 404 Not Found errors that stem
2122
from the upgrade process.
2223

23-
This mechanism is called the _Mixed Version Proxy_.
24+
This mechanism is called the _Mixed Version Proxy_.
2425

2526
## Enabling the Mixed Version Proxy
26-
Ensure that `UnknownVersionInteroperabilityProxy` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
27+
28+
Ensure that `UnknownVersionInteroperabilityProxy` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
2729
is enabled when you start the {{< glossary_tooltip text="API Server" term_id="kube-apiserver" >}}:
2830

2931
```shell
@@ -46,38 +48,58 @@ kube-apiserver \
4648

4749
### Proxy transport and authentication between API servers {#transport-and-authn}
4850

49-
* The source kube-apiserver reuses the [existing APIserver client authentication flags](https://kubernetes.io/docs/tasks/extend-kubernetes/configure-aggregation-layer/#kubernetes-apiserver-client-authentication) `--proxy-client-cert-file` and `--proxy-client-key-file` to present its identity that will be verified by its peer (the destination kube-apiserver). The destination API server verifies that peer connection based on the configuration you specify using the `--requestheader-client-ca-file` command line argument.
51+
* The source kube-apiserver reuses the
52+
[existing APIserver client authentication flags](/docs/tasks/extend-kubernetes/configure-aggregation-layer/#kubernetes-apiserver-client-authentication)
53+
`--proxy-client-cert-file` and `--proxy-client-key-file` to present its identity that
54+
will be verified by its peer (the destination kube-apiserver). The destination API server
55+
verifies that peer connection based on the configuration you specify using the
56+
`--requestheader-client-ca-file` command line argument.
5057

51-
* To authenticate the destination server's serving certs, you must configure a certificate authority bundle by specifying the `--peer-ca-file` command line argument to the **source** API server.
58+
* To authenticate the destination server's serving certs, you must configure a certificate
59+
authority bundle by specifying the `--peer-ca-file` command line argument to the **source** API server.
5260

5361
### Configuration for peer API server connectivity
5462

55-
To set the network location of a kube-apiserver that peers will use to proxy requests, use the
56-
`--peer-advertise-ip` and `--peer-advertise-port` command line arguments to kube-apiserver or specify
63+
To set the network location of a kube-apiserver that peers will use to proxy requests, use the
64+
`--peer-advertise-ip` and `--peer-advertise-port` command line arguments to kube-apiserver or specify
5765
these fields in the API server configuration file.
5866
If these flags are unspecified, peers will use the value from either `--advertise-address` or
5967
`--bind-address` command line argument to the kube-apiserver. If those too, are unset, the host's default interface is used.
6068

6169
## Mixed version proxying
6270

63-
When you enable mixed version proxying, the [aggregation layer](/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation/)
71+
When you enable mixed version proxying, the [aggregation layer](/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation/)
6472
loads a special filter that does the following:
6573

66-
* When a resource request reaches an API server that cannot serve that API (either because it is at a version pre-dating the introduction of the API or the API is turned off on the API server) the API server attempts to send the request to a peer API server that can serve the requested API. It does so by identifying API groups / versions / resources that the local server doesn't recognise, and tries to proxy those requests to a peer API server that is capable of handling the request.
67-
* If the peer API server fails to respond, the _source_ API server responds with 503("Service Unavailable") error.
74+
* When a resource request reaches an API server that cannot serve that API
75+
(either because it is at a version pre-dating the introduction of the API or the API is turned off on the API server)
76+
the API server attempts to send the request to a peer API server that can serve the requested API.
77+
It does so by identifying API groups / versions / resources that the local server doesn't recognise,
78+
and tries to proxy those requests to a peer API server that is capable of handling the request.
79+
* If the peer API server fails to respond, the _source_ API server responds with 503 ("Service Unavailable") error.
6880

6981
### How it works under the hood
7082

71-
When an API Server receives a resource request, it first checks which API servers can serve the requested resource. This check happens using the internal [`StorageVersion` API].
72-
73-
* If the resource is known to the API server that received the request (ex: `GET /api/v1/pods/some-pod`), the request is handled locally.
74-
75-
* If there is no internal `StorageVersion` object found for the requested resource (ex: `GET /my-api/v1/my-resource`) and the configured APIService specifies proxying to an extension API server, that proxying happens following the usual
76-
[flow](/docs/tasks/extend-kubernetes/configure-aggregation-layer/) for
77-
extension APIs.
78-
79-
* If a valid internal `StorageVersion` object is found for the requested resource (ex: `GET /batch/v1/jobs`) and the API server trying to handle the request (the _handling API server_) has the `batch` API disabled, then the _handling API server_fetches the peer API servers that do serve the relevant API group / version / resource (`api/v1/batch` in this case) using the information in the fetched `StorageVersion` object. The _handling API server_ then proxies the request to one of the matching peer kube-apiservers that are aware of the requested resource.
80-
* If there is no peer known for that API group / version / resource, the handling API server passes the request to its own handler chain which should eventually return a 404("Not Found") response.
83+
When an API Server receives a resource request, it first checks which API servers can
84+
serve the requested resource. This check happens using the internal `StorageVersion` API.
85+
86+
* If the resource is known to the API server that received the request
87+
(for example, `GET /api/v1/pods/some-pod`), the request is handled locally.
88+
89+
* If there is no internal `StorageVersion` object found for the requested resource
90+
(for example, `GET /my-api/v1/my-resource`) and the configured APIService specifies proxying
91+
to an extension API server, that proxying happens following the usual
92+
[flow](/docs/tasks/extend-kubernetes/configure-aggregation-layer/) for extension APIs.
93+
94+
* If a valid internal `StorageVersion` object is found for the requested resource
95+
(for example, `GET /batch/v1/jobs`) and the API server trying to handle the request
96+
(the _handling API server_) has the `batch` API disabled, then the _handling API server_
97+
fetches the peer API servers that do serve the relevant API group / version / resource
98+
(`api/v1/batch` in this case) using the information in the fetched `StorageVersion` object.
99+
The _handling API server_ then proxies the request to one of the matching peer kube-apiservers
100+
that are aware of the requested resource.
101+
* If there is no peer known for that API group / version / resource, the handling API server
102+
passes the request to its own handler chain which should eventually return a 404 ("Not Found") response.
81103
* If the handling API server has identified and selected a peer API server, but that peer fails
82104
to respond (for reasons such as network connectivity issues, or a data race between the request
83105
being received and a controller registering the peer's info into the control plane), then the handling

0 commit comments

Comments
 (0)