Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit be0a752

Browse files
authored
Merge branch 'master' into patch-1
2 parents d89c7f6 + ca4f311 commit be0a752

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1245
-705
lines changed

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Bug report
3+
about: Share about things that are not working as expected
4+
labels: kind/bug
5+
6+
---
7+
8+
**What happened (please include outputs or screenshots)**:
9+
10+
**What you expected to happen**:
11+
12+
**How to reproduce it (as minimally and precisely as possible)**:
13+
14+
**Anything else we need to know?**:
15+
16+
**Environment**:
17+
- Kubernetes version (`kubectl version`):
18+
- OS (e.g., MacOS 10.13.6):
19+
- Python version (`python --version`)
20+
- Python client version (`pip list | grep kubernetes`)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: Documentation
3+
about: Report any mistakes or missing information from the documentation or the examples
4+
labels: kind/documentation
5+
6+
---
7+
8+
**Link to the issue (please include a link to the specific documentation or example)**:
9+
10+
**Description of the issue (please include outputs or screenshots if possible)**:

.github/ISSUE_TEMPLATE/feature.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: Feature request
3+
about: Suggest a new feature for the project
4+
labels: kind/feature
5+
6+
---
7+
8+
**What is the feature and why do you need it**:
9+
10+
**Describe the solution you'd like to see**:

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,7 @@ target/
6767
.idea/*
6868
*.iml
6969
.vscode
70+
71+
# created by sphinx documentation build
72+
doc/source/README.md
73+
doc/_build

.travis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# ref: https://docs.travis-ci.com/user/languages/python
22
language: python
33
dist: xenial
4-
sudo: true
54
services:
65
- docker
76

@@ -13,12 +12,10 @@ matrix:
1312
env: TOXENV=py27-functional
1413
- python: 2.7
1514
env: TOXENV=update-pycodestyle
16-
- python: 2.7
15+
- python: 3.7
1716
env: TOXENV=docs
1817
- python: 2.7
1918
env: TOXENV=coverage,codecov
20-
- python: 3.4
21-
env: TOXENV=py34
2219
- python: 3.5
2320
env: TOXENV=py35
2421
- python: 3.5
@@ -31,6 +28,10 @@ matrix:
3128
env: TOXENV=py37
3229
- python: 3.7
3330
env: TOXENV=py37-functional
31+
- python: 3.8
32+
env: TOXENV=py38
33+
- python: 3.8
34+
env: TOXENV=py38-functional
3435

3536
install:
3637
- pip install tox

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
- Introduce RuntimeClass to NodeV1alpha1Api and NodeV1beta1Api [kubernetes/kubernetes#74433](https://github.com/kubernetes/kubernetes/pull/74433)
2626
- Graduate PriorityClass API to GA SchedulingV1Api [kubernetes/kubernetes#73555](https://github.com/kubernetes/kubernetes/pull/73555)
2727
- Introduce CSINodeInfo and CSIDriver to StorageV1beta1Api [kubernetes/kubernetes#74283](https://github.com/kubernetes/kubernetes/pull/74283)
28+
- The alpha Initializers feature, `admissionregistration.k8s.io/v1alpha1` API version, `Initializers` admission plugin, and use of the `metadata.initializers` API field have been removed. Discontinue use of the alpha feature and delete any existing `InitializerConfiguration` API objects before upgrading. The `metadata.initializers` field will be removed in a future release. The parameter `include_uninitialized` has been removed. [kubernetes/kubernetes#72972](https://github.com/kubernetes/kubernetes/pull/72972)
2829

2930
# v9.0.0
3031
**Bug Fix:**

OWNERS

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# See the OWNERS docs at https://go.k8s.io/owners
22

33
approvers:
4-
- mbohlool
4+
- roycaihw
5+
- yliaog
6+
emeritus_approvers:
57
- caesarxuchao
68
- lavalamp
7-
- yliaog
8-
- roycaihw
9+
- mbohlool
10+
reviewers:
11+
- micw523

README.md

Lines changed: 14 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ From [PyPi](https://pypi.python.org/pypi/kubernetes/) directly:
2525
pip install kubernetes
2626
```
2727

28-
## Example
28+
## Examples
2929

3030
list all pods:
3131

@@ -68,7 +68,7 @@ More examples can be found in [examples](examples/) folder. To run examples, run
6868
python -m examples.example1
6969
```
7070

71-
(replace example1 with the example base filename)
71+
(replace example1 with one of the filenames in the examples folder)
7272

7373
## Documentation
7474

@@ -77,24 +77,20 @@ All APIs and Models' documentation can be found at the [Generated client's READM
7777
## Compatibility
7878

7979
`client-python` follows [semver](http://semver.org/), so until the major version of
80-
client-python gets increased, your code will continue to work with explicitly
80+
client-python gets increased, your code will continue to work with explicitly
8181
supported versions of Kubernetes clusters.
8282

8383
#### Compatibility matrix
8484

85-
| | Kubernetes 1.5 | Kubernetes 1.6 | Kubernetes 1.7 | Kubernetes 1.8 | Kubernetes 1.9 | Kubernetes 1.10 | Kubernetes 1.11 | Kubernetes 1.12 | Kubernetes 1.13 | Kubernetes 1.14 |
86-
|--------------------|----------------|----------------|----------------|----------------|----------------|-----------------|-----------------|-----------------|-----------------|-----------------|
87-
| client-python 1.0 || - | - |- |- |- |- |- |- |- |
88-
| client-python 2.0 | + || - |- |- |- |- |- |- |- |
89-
| client-python 3.0 | + | + ||- |- |- |- |- |- |- |
90-
| client-python 4.0 | + | + | + ||- |- |- |- |- |- |
91-
| client-python 5.0 | + | + | + |+ ||- |- |- |- |- |
92-
| client-python 6.0 | + | + | + |+ |+ ||- |- |- |- |
93-
| client-python 7.0 | + | + | + |+ |+ |+ ||- |- |- |
94-
| client-python 8.0 | + | + | + |+ |+ |+ |+ ||- |- |
95-
| client-python 9.0 | + | + | + |+ |+ |+ |+ |+ ||- |
96-
| client-python 10.0 | + | + | + |+ |+ |+ |+ |+ |+ ||
97-
| client-python HEAD | + | + | + |+ |+ |+ |+ |+ |+ ||
85+
| | Kubernetes 1.9 | Kubernetes 1.10 | Kubernetes 1.11 | Kubernetes 1.12 | Kubernetes 1.13 | Kubernetes 1.14 |
86+
|--------------------|----------------|-----------------|-----------------|-----------------|-----------------|-----------------|
87+
| client-python 5.0 ||- |- |- |- |- |
88+
| client-python 6.0 |+ ||- |- |- |- |
89+
| client-python 7.0 |+ |+ ||- |- |- |
90+
| client-python 8.0 |+ |+ |+ ||- |- |
91+
| client-python 9.0 |+ |+ |+ |+ ||- |
92+
| client-python 10.0 |+ |+ |+ |+ |+ ||
93+
| client-python HEAD |+ |+ |+ |+ |+ ||
9894

9995
Key:
10096

@@ -110,14 +106,6 @@ between client-python versions.
110106

111107
| Client version | Canonical source for OpenAPI spec | Maintenance status |
112108
|-----------------|--------------------------------------|-------------------------------|
113-
| 1.0 Alpha/Beta | Kubernetes main repo, 1.5 branch ||
114-
| 1.0.x | Kubernetes main repo, 1.5 branch ||
115-
| 2.0 Alpha/Beta | Kubernetes main repo, 1.6 branch ||
116-
| 2.0.x | Kubernetes main repo, 1.6 branch ||
117-
| 3.0 Alpha/Beta | Kubernetes main repo, 1.7 branch ||
118-
| 3.0 | Kubernetes main repo, 1.7 branch ||
119-
| 4.0 Alpha/Beta | Kubernetes main repo, 1.8 branch ||
120-
| 4.0 | Kubernetes main repo, 1.8 branch ||
121109
| 5.0 Alpha/Beta | Kubernetes main repo, 1.9 branch ||
122110
| 5.0 | Kubernetes main repo, 1.9 branch ||
123111
| 6.0 Alpha/Beta | Kubernetes main repo, 1.10 branch ||
@@ -142,18 +130,12 @@ Note: There would be no maintenance for alpha/beta releases except the latest on
142130

143131
## Community, Support, Discussion
144132

145-
If you have any problem on using the package or any suggestions, please start with reaching the [Kubernetes clients slack channel](https://kubernetes.slack.com/messages/C76GB48RK/), or filing an [issue](https://github.com/kubernetes-client/python/issues) to let us know. You can also reach the maintainers of this project at [SIG API Machinery](https://github.com/kubernetes/community/tree/master/sig-api-machinery).
133+
If you have any problem on using the package or any suggestions, please start with reaching the [Kubernetes clients slack channel](https://kubernetes.slack.com/messages/C76GB48RK/), or filing an [issue](https://github.com/kubernetes-client/python/issues) to let us know. You can also reach the maintainers of this project at [SIG API Machinery](https://github.com/kubernetes/community/tree/master/sig-api-machinery), where this project falls under.
146134

147135
### Code of Conduct
148136

149137
Participation in the Kubernetes community is governed by the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).
150138

151-
## Kubernetes Incubator
152-
153-
This is a [Kubernetes Incubator project](https://github.com/kubernetes/community/blob/master/incubator.md).
154-
155-
* [SIG: sig-api-machinery](https://github.com/kubernetes/community/tree/master/sig-api-machinery)
156-
157139
## Troubleshooting
158140

159141
### SSLError on macOS
@@ -184,9 +166,9 @@ Specifically check `ipaddress` and `urllib3` package versions to make sure they
184166

185167
Starting from 4.0 release, we do not support directly calling exec or attach calls. you should use stream module to call them. so instead
186168
of `resp = api.connect_get_namespaced_pod_exec(name, ...` you should call `resp = stream(api.connect_get_namespaced_pod_exec, name, ...`.
187-
See more at [exec example](examples/exec.py).
188169

189170
Using Stream will overwrite the requests protocol in _core_v1_api.CoreV1Api()_
190171
This will cause a failure in non-exec/attach calls. If you reuse your api client object, you will need to
191172
recreate it between api calls that use _stream_ and other api calls.
192173

174+
See more at [exec example](examples/pod_exec.py).

RELEASE.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
The Kubernetes Python client is released on an as-needed basis. The process is as follows:
44

55
1. An issue is proposing a new release with a changelog since the last release
6+
1. Update the support matrix in README.md removing the oldest version and adding the
7+
proposed release.
68
1. All [OWNERS](OWNERS) must LGTM this release
7-
1. An OWNER runs `git tag -s $VERSION` and inserts the changelog and pushes the tag with `git push $VERSION`
9+
1. An OWNER runs `git tag -s $VERSION` and inserts the changelog and pushes
10+
the tag with `git push $VERSION`
811
1. The release issue is closed
9-
1. An announcement email is sent to `[email protected]` with the subject `[ANNOUNCE] kubernetes-python-client $VERSION is released`
12+
1. An announcement email is sent to `[email protected]`
13+
with the subject `[ANNOUNCE] kubernetes-python-client $VERSION is released`

doc/Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS = -c source
6+
SPHINXBUILD = sphinx-build
7+
SPHINXPROJ = kubernetes-python
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
html:
20+
$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
21+
@echo "\nDocs rendered successfully, open _/build/html/index.html to view"

doc/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Building the documentation
2+
==========================
3+
4+
Install the test requirements with:
5+
6+
```
7+
$ pip install -r ../test-requirements.txt
8+
```
9+
10+
Use `make html` to build the docs in html format.
11+

doc/requirements-docs.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
recommonmark
2+
sphinx_markdown_tables

doc/source/conf.py

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,37 @@
1313
# limitations under the License.
1414

1515
import os
16+
import re
17+
import shutil
1618
import sys
1719

18-
from recommonmark.parser import CommonMarkParser
20+
from recommonmark.transform import AutoStructify
21+
22+
# Work around https://github.com/readthedocs/recommonmark/issues/152
23+
new_readme = []
24+
25+
with open("../../README.md", "r") as r:
26+
lines = r.readlines()
27+
for l in lines:
28+
nl = re.sub("\[!\[[\w\s]+\]\(", "[![](", l)
29+
new_readme.append(nl)
30+
31+
with open("README.md", "w") as n:
32+
n.writelines(new_readme)
33+
34+
# apparently index.rst can't search for markdown not in the same directory
35+
shutil.copy("../../CONTRIBUTING.md", ".")
1936

2037
sys.path.insert(0, os.path.abspath('../..'))
2138
# -- General configuration ----------------------------------------------------
2239

23-
source_parsers = {
24-
'.md': CommonMarkParser,
25-
}
26-
2740
source_suffix = ['.rst', '.md']
2841

2942
# Add any Sphinx extension module names here, as strings. They can be
3043
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
3144
extensions = [
45+
'sphinx_markdown_tables',
46+
'recommonmark',
3247
'sphinx.ext.autodoc',
3348
#'sphinx.ext.intersphinx',
3449
]
@@ -80,3 +95,10 @@
8095

8196
# Example configuration for intersphinx: refer to the Python standard library.
8297
#intersphinx_mapping = {'http://docs.python.org/': None}
98+
def setup(app):
99+
app.add_config_value('recommonmark_config', {
100+
'auto_toc_tree_section': 'Contents',
101+
'enable_eval_rst': True,
102+
}, True)
103+
app.add_transform(AutoStructify)
104+

doc/source/contributing.rst

Lines changed: 0 additions & 4 deletions
This file was deleted.

doc/source/index.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ Contents:
1111
.. toctree::
1212
:maxdepth: 2
1313

14-
readme
14+
README <README.md>
1515
installation
1616
usage
17+
examples
1718
modules
18-
contributing
19+
contributing <CONTRIBUTING.md>
1920

2021
Indices and tables
2122
==================

doc/source/readme.rst

Lines changed: 0 additions & 4 deletions
This file was deleted.

doc/source/usage.rst

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22
Usage
33
========
44

5-
To use kubernetes-python-client in a project::
5+
The directory ``examples`` contains a few examples on how to use the client.
66

7-
import kubernetes
7+
8+
Deployments
9+
-----------
10+
11+
Here is a simple usage of creating a deployment from a yaml file:
12+
13+
14+
.. literalinclude:: ../../examples/create_deployment.py
15+
16+
17+
The following example demostrates how to create, update and delete deployments
18+
without the need to read a file from the disk:
19+
20+
.. literalinclude:: ../../examples/deployment_examples.py

examples/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Python Client Examples
2+
3+
This directory contains various examples of how to use the Python client.
4+
Please read the description at the top of each example for more information
5+
about what the script does and any prequisites. Most scripts also include
6+
comments throughout the code.
7+
8+
## Setup
9+
10+
These scripts require Python 2.7 or 3.5+ and the Kubernetes client which can be
11+
installed following the directions
12+
[here](https://github.com/kubernetes-client/python#installation).
13+
14+
## Contributions
15+
16+
If you find a problem please file an
17+
[issue](https://github.com/kubernetes-client/python/issues).

examples/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# Empty init file to make examples folder a python module.
15+
# Empty init file to make examples folder a python module

0 commit comments

Comments
 (0)