Skip to content

Commit 6850340

Browse files
authored
Merge pull request #1519 from roycaihw/release18
Pull master into release-18.0
2 parents 0b146c3 + 8bd7651 commit 6850340

File tree

13 files changed

+156
-14
lines changed

13 files changed

+156
-14
lines changed

.github/workflows/e2e-master.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
with:
2020
submodules: true
2121
- name: Create Kind Cluster
22-
uses: helm/kind-action@v1.1.0
22+
uses: helm/kind-action@v1.2.0
2323
with:
2424
cluster_name: kubernetes-python-e2e-master-${{ matrix.python-version }}
2525
# The kind version to be used to spin the cluster up

.github/workflows/e2e-release-11.0.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
with:
2020
submodules: true
2121
- name: Create Kind Cluster
22-
uses: helm/kind-action@v1.1.0
22+
uses: helm/kind-action@v1.2.0
2323
with:
2424
cluster_name: kubernetes-python-e2e-release-11.0-${{ matrix.python-version }}
2525
# The kind version to be used to spin the cluster up

.github/workflows/e2e-release-12.0.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
with:
2020
submodules: true
2121
- name: Create Kind Cluster
22-
uses: helm/kind-action@v1.1.0
22+
uses: helm/kind-action@v1.2.0
2323
with:
2424
cluster_name: kubernetes-python-e2e-release-12.0-${{ matrix.python-version }}
2525
# The kind version to be used to spin the cluster up

.github/workflows/e2e-release-17.0.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
with:
2020
submodules: true
2121
- name: Create Kind Cluster
22-
uses: helm/kind-action@v1.1.0
22+
uses: helm/kind-action@v1.2.0
2323
with:
2424
cluster_name: kubernetes-python-e2e-release-17.0-${{ matrix.python-version }}
2525
# The kind version to be used to spin the cluster up

.github/workflows/e2e-release-18.0.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
with:
2020
submodules: true
2121
- name: Create Kind Cluster
22-
uses: helm/kind-action@v1.1.0
22+
uses: helm/kind-action@v1.2.0
2323
with:
2424
cluster_name: kubernetes-python-e2e-release-18.0-${{ matrix.python-version }}
2525
# The kind version to be used to spin the cluster up

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# v18.0.0-snapshot
2+
3+
Kubernetes API Version: To Be Updated
4+
5+
### Feature
6+
- Support for the dryRun parameter has been added to the dynamic client. ([kubernetes-client/python-base#247](https://github.com/kubernetes-client/python-base/pull/247), [@gravesm](https://github.com/gravesm))
7+
- The `python2` support will be removed in 18.0.0 beta release. All the tests will use `python3` versions. ([kubernetes-client/python-base#238](https://github.com/kubernetes-client/python-base/pull/238), [@Priyankasaggu11929](https://github.com/Priyankasaggu11929))
8+
- The dynamic client now supports customizing http "Accept" header through the `header_params` parameter, which can be used to customizing API server response, e.g. retrieving object metadata only. ([kubernetes-client/python-base#236](https://github.com/kubernetes-client/python-base/pull/236), [@Yashks1994](https://github.com/Yashks1994))
9+
- Allow optional list of YAML objects as param to `create_from_yaml` util [kubernetes-client/python#1403](https://github.com/kubernetes-client/python/pull/1403)
10+
11+
**Bug Fix:**
12+
- Fix empty yaml document in `create_from_yaml` [kubernetes-client/python#1506](https://github.com/kubernetes-client/python/pull/1506)
13+
114
# v18.20.0b1
215

316
Kubernetes API Version: 1.18.20

examples/pod_namespace_watch.py renamed to examples/watch/pod_namespace_watch.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
The script will wait for 10 events related to namespaces to occur within
1818
the `timeout_seconds` threshold and then move on to wait for another 10 events
1919
related to pods to occur within the `timeout_seconds` threshold.
20+
21+
22+
Refer to the document below to understand the server-side & client-side
23+
timeout settings for the watch request handler: ~
24+
25+
https://github.com/github.com/kubernetes-client/python/blob/master/examples/watch/timeout-settings.md
2026
"""
2127

2228
from kubernetes import client, config, watch

examples/watch/timeout-settings.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
2+
**This documentation briefly provides information about the `server side` & `client side` connection timeout settings, in the watch request handler.**
3+
4+
---
5+
6+
There are two inputs available in the client, that could be used to set connection timeouts:
7+
8+
- `timeout_seconds`
9+
- `_request_timeout`
10+
11+
---
12+
13+
#### Sever-side timeout (`kwargs['timeout_seconds'] = n`)
14+
15+
- The value of the argument `timeout_seconds`, **n**, (which is time duration in seconds) is consumed at the server side. It is included in the request URL to the server.
16+
17+
*For eg.* ~ `https://localhost:6443/api/v1/namespaces/default/pods?labelSelector=app%3Ddemo&timeoutSeconds=100&watch=True`
18+
19+
- In case, if the `timeout_seconds` value is set, the value `n` would determine the server-side connection timeout duration.
20+
21+
*For eg.* ~ if `kwargs['timeout_seconds'] = 3600`, then the server-side connection timeout will be equal to 1 hour.
22+
23+
This timeout duration is determined by the expression ~ `timeout = time.Duration(3600) * time.seconds`, *i.e.* `timeout = 1 hour`
24+
25+
***Refer:***
26+
- *[https://github.com/kubernetes/apiserver/blob/release-1.20/pkg/endpoints/handlers/get.go#L254](https://github.com/kubernetes/apiserver/blob/release-1.20/pkg/endpoints/handlers/get.go#L254)*
27+
28+
- In case, if the `timeout_seconds` value is not set, then the connection timeout will be a randomized value (in seconds) between `minRequestTimeout` and 2*`minRequestTimeout`, to spread out the load.
29+
30+
It is determined using the expression ~ `timeout = time.Duration(float64(minRequestTimeout) * (rand.Float64() + 1.0))`
31+
32+
Where `minRequestTimeout` indicates the minimum number of seconds a handler must keep a request open before timing it out.
33+
34+
The default value of `minRequestTimeout` is 1800 seconds.
35+
36+
***Refer:***
37+
- *[https://github.com/kubernetes/apiserver/blob/release-1.20/pkg/endpoints/handlers/get.go#L257](https://github.com/kubernetes/apiserver/blob/release-1.20/pkg/endpoints/handlers/get.go#L257)*
38+
- *[https://github.com/kubernetes/kubernetes/blob/release-1.20/staging/src/k8s.io/apiserver/pkg/server/config.go#L320](https://github.com/kubernetes/kubernetes/blob/release-1.20/staging/src/k8s.io/apiserver/pkg/server/config.go#L320)*
39+
40+
- In case of a network outage, the server side timeout value will have no effect & the client will hang indefinitely without raising any exception. Note, that this is the case provided when there is no other client-side timeout (i.e., `_request_timeout`) value specified.
41+
42+
(*See the section below for information on `client side timeout`*)
43+
44+
- It is recommended to set this timeout value to a higher number such as 3600 seconds (1 hour).
45+
46+
---
47+
48+
#### Client-side timeout (`kwargs['_request_timeout'] = n`)
49+
50+
- The value of the argument `_request_timeout`, **n** (which is time duration in seconds) is set to the socket used for the connection.
51+
52+
- In case, if the `_request_timeout` value is set, this argument can accept 2 types of input values ~
53+
- float,
54+
- a tuple (with a length of 2)
55+
56+
***Refer***
57+
- *[https://github.com/kubernetes-client/python/blob/v17.17.0/kubernetes/client/api_client.py#L336-L339](https://github.com/kubernetes-client/python/blob/v17.17.0/kubernetes/client/api_client.py#L336-L339)*
58+
59+
- In case of network outage, leading to dropping all packets with no RST/FIN, the timeout value (in seconds) determined by the `request_timeout` argument, would be the time duration for how long the client will wait before dropping the connection.
60+
61+
- When the timeout happens, an exception will be raised, for eg. ~
62+
63+
`urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='localhost', port=6443): Read timed out.`
64+
65+
- In case, if the `_request_timeout` value is not set, then the default value is **`None`** & socket will have no timeout.
66+
67+
***Refer:***
68+
- *[https://docs.python.org/3/library/socket.html#socket.getdefaulttimeout](https://docs.python.org/3/library/socket.html#socket.getdefaulttimeout)*
69+
70+
- It is recommended to set this timeout value to a lower number (for eg. ~ maybe 60 seconds).
71+

kubernetes/client/models/v1_projected_volume_source.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,6 @@ def sources(self, sources):
9999
:param sources: The sources of this V1ProjectedVolumeSource. # noqa: E501
100100
:type: list[V1VolumeProjection]
101101
"""
102-
if self.local_vars_configuration.client_side_validation and sources is None: # noqa: E501
103-
raise ValueError("Invalid value for `sources`, must not be `None`") # noqa: E501
104-
105102
self._sources = sources
106103

107104
def to_dict(self):

0 commit comments

Comments
 (0)