• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.github/H19-Aug-2021-

applyconfigurations/H19-Aug-2021-

discovery/H19-Aug-2021-

dynamic/H19-Aug-2021-

examples/H19-Aug-2021-

informers/H19-Aug-2021-

kubernetes/H19-Aug-2021-

kubernetes_test/H19-Aug-2021-

listers/H19-Aug-2021-

metadata/H19-Aug-2021-

pkg/H19-Aug-2021-

plugin/pkg/client/auth/H19-Aug-2021-

rest/H19-Aug-2021-

restmapper/H19-Aug-2021-

scale/H19-Aug-2021-

testing/H19-Aug-2021-

third_party/forked/golang/template/H19-Aug-2021-

tools/H19-Aug-2021-

transport/H19-Aug-2021-

util/H19-Aug-2021-

CHANGELOG.mdH A D19-Aug-202142.9 KiB

CONTRIBUTING.mdH A D19-Aug-2021790

INSTALL.mdH A D19-Aug-20213.4 KiB

LICENSEH A D19-Aug-202111.1 KiB

OWNERSH A D19-Aug-2021263

README.mdH A D19-Aug-20219.9 KiB

SECURITY_CONTACTSH A D19-Aug-2021554

code-of-conduct.mdH A D19-Aug-2021148

go.modH A D19-Aug-20211.5 KiB

go.sumH A D19-Aug-202145.2 KiB

README.md

1# client-go
2
3Go clients for talking to a [kubernetes](http://kubernetes.io/) cluster.
4
5We recommend using the `v0.x.y` tags for Kubernetes releases >= `v1.17.0` and
6`kubernetes-1.x.y` tags for Kubernetes releases < `v1.17.0`.
7
8The fastest way to add this library to a project is to run `go get k8s.io/client-go@latest` with go1.16+.
9See [INSTALL.md](/INSTALL.md) for detailed installation instructions and troubleshooting.
10
11[![GoDocWidget]][GoDocReference]
12
13[GoDocWidget]: https://godoc.org/k8s.io/client-go?status.svg
14[GoDocReference]:https://godoc.org/k8s.io/client-go
15
16## Table of Contents
17
18- [What's included](#whats-included)
19- [Versioning](#versioning)
20  - [Compatibility: your code <-> client-go](#compatibility-your-code---client-go)
21  - [Compatibility: client-go <-> Kubernetes clusters](#compatibility-client-go---kubernetes-clusters)
22  - [Compatibility matrix](#compatibility-matrix)
23  - [Why do the 1.4 and 1.5 branch contain top-level folder named after the version?](#why-do-the-14-and-15-branch-contain-top-level-folder-named-after-the-version)
24- [Kubernetes tags](#kubernetes-tags)
25- [How to get it](#how-to-get-it)
26- [How to use it](#how-to-use-it)
27- [Dependency management](#dependency-management)
28- [Contributing code](#contributing-code)
29
30### What's included
31
32* The `kubernetes` package contains the clientset to access Kubernetes API.
33* The `discovery` package is used to discover APIs supported by a Kubernetes API server.
34* The `dynamic` package contains a dynamic client that can perform generic operations on arbitrary Kubernetes API objects.
35* The `plugin/pkg/client/auth` packages contain optional authentication plugins for obtaining credentials from external sources.
36* The `transport` package is used to set up auth and start a connection.
37* The `tools/cache` package is useful for writing controllers.
38
39### Versioning
40
41- For each `v1.x.y` Kubernetes release, the major version (first digit)
42would remain `0`.
43
44- Bugfixes will result in the patch version (third digit) changing. PRs that are
45cherry-picked into an older Kubernetes release branch will result in an update
46to the corresponding branch in `client-go`, with a corresponding new tag
47changing the patch version.
48
49#### Branches and tags.
50
51We will create a new branch and tag for each increment in the minor version
52number. We will create only a new tag for each increment in the patch
53version number. See [semver](http://semver.org/) for definitions of major,
54minor, and patch.
55
56The HEAD of the master branch in client-go will track the HEAD of the master
57branch in the main Kubernetes repo.
58
59#### Compatibility: your code <-> client-go
60
61The `v0.x.y` tags indicate that go APIs may change in incompatible ways in
62different versions.
63
64See [INSTALL.md](INSTALL.md) for guidelines on requiring a specific
65version of client-go.
66
67#### Compatibility: client-go <-> Kubernetes clusters
68
69Since Kubernetes is backwards compatible with clients, older `client-go`
70versions will work with many different Kubernetes cluster versions.
71
72We will backport bugfixes--but not new features--into older versions of
73`client-go`.
74
75
76#### Compatibility matrix
77
78|                               | Kubernetes 1.15 | Kubernetes 1.16 | Kubernetes 1.17 | Kubernetes 1.18 | Kubernetes 1.19 | Kubernetes 1.20 |
79|-------------------------------|-----------------|-----------------|-----------------|-----------------|-----------------|-----------------|
80| `kubernetes-1.15.0`           | ✓               | +-              | +-              | +-              | +-              | +-              |
81| `kubernetes-1.16.0`           | +-              | ✓               | +-              | +-              | +-              | +-              |
82| `kubernetes-1.17.0`/`v0.17.0` | +-              | +-              | ✓               | +-              | +-              | +-              |
83| `kubernetes-1.18.0`/`v0.18.0` | +-              | +-              | +-              | ✓               | +-              | +-              |
84| `kubernetes-1.19.0`/`v0.19.0` | +-              | +-              | +-              | +-              | ✓               | +-              |
85| `kubernetes-1.20.0`/`v0.20.0` | +-              | +-              | +-              | +-              | +-              | ✓               |
86| `HEAD`                        | +-              | +-              | +-              | +-              | +-              | +-              |
87
88Key:
89
90* `✓` Exactly the same features / API objects in both client-go and the Kubernetes
91  version.
92* `+` client-go has features or API objects that may not be present in the
93  Kubernetes cluster, either due to that client-go has additional new API, or
94  that the server has removed old API. However, everything they have in
95  common (i.e., most APIs) will work. Please note that alpha APIs may vanish or
96  change significantly in a single release.
97* `-` The Kubernetes cluster has features the client-go library can't use,
98  either due to the server has additional new API, or that client-go has
99  removed old API. However, everything they share in common (i.e., most APIs)
100  will work.
101
102See the [CHANGELOG](./CHANGELOG.md) for a detailed description of changes
103between client-go versions.
104
105| Branch         | Canonical source code location       | Maintenance status            |
106|----------------|--------------------------------------|-------------------------------|
107| `release-1.4`  | Kubernetes main repo, 1.4 branch     | = -                           |
108| `release-1.5`  | Kubernetes main repo, 1.5 branch     | = -                           |
109| `release-2.0`  | Kubernetes main repo, 1.5 branch     | = -                           |
110| `release-3.0`  | Kubernetes main repo, 1.6 branch     | = -                           |
111| `release-4.0`  | Kubernetes main repo, 1.7 branch     | = -                           |
112| `release-5.0`  | Kubernetes main repo, 1.8 branch     | = -                           |
113| `release-6.0`  | Kubernetes main repo, 1.9 branch     | = -                           |
114| `release-7.0`  | Kubernetes main repo, 1.10 branch    | = -                           |
115| `release-8.0`  | Kubernetes main repo, 1.11 branch    | =-                            |
116| `release-9.0`  | Kubernetes main repo, 1.12 branch    | =-                            |
117| `release-10.0` | Kubernetes main repo, 1.13 branch    | =-                            |
118| `release-11.0` | Kubernetes main repo, 1.14 branch    | =-                            |
119| `release-12.0` | Kubernetes main repo, 1.15 branch    | =-                            |
120| `release-13.0` | Kubernetes main repo, 1.16 branch    | =-                            |
121| `release-14.0` | Kubernetes main repo, 1.17 branch    | ✓                             |
122| `release-1.18` | Kubernetes main repo, 1.18 branch    | ✓                             |
123| `release-1.19` | Kubernetes main repo, 1.19 branch    | ✓                             |
124| `release-1.20` | Kubernetes main repo, 1.20 branch    | ✓                             |
125| client-go HEAD | Kubernetes main repo, master branch  | ✓                             |
126
127Key:
128
129* `✓` Changes in main Kubernetes repo are actively published to client-go by a bot
130* `=` Maintenance is manual, only severe security bugs will be patched.
131* `-` Deprecated; please upgrade.
132
133#### Deprecation policy
134
135We will maintain branches for at least six months after their first stable tag
136is cut. (E.g., the clock for the release-2.0 branch started ticking when we
137tagged v2.0.0, not when we made the first alpha.) This policy applies to
138every version greater than or equal to 2.0.
139
140#### Why do the 1.4 and 1.5 branch contain top-level folder named after the version?
141
142For the initial release of client-go, we thought it would be easiest to keep
143separate directories for each minor version. That soon proved to be a mistake.
144We are keeping the top-level folders in the 1.4 and 1.5 branches so that
145existing users won't be broken.
146
147### Kubernetes tags
148
149This repository is still a mirror of
150[k8s.io/kubernetes/staging/src/client-go](https://github.com/kubernetes/kubernetes/tree/master/staging/src/k8s.io/client-go),
151the code development is still done in the staging area.
152
153Since Kubernetes `v1.8.0`, when syncing the code from the staging area,
154we also sync the Kubernetes version tags to client-go, prefixed with
155`kubernetes-`. From Kubernetes `v1.17.0`, we also create matching semver
156`v0.x.y` tags for each `v1.x.y` Kubernetes release.
157
158For example, if you check out the `kubernetes-1.17.0` or the `v0.17.0` tag in
159client-go, the code you get is exactly the same as if you check out the `v1.17.0`
160tag in Kubernetes, and change directory to `staging/src/k8s.io/client-go`.
161
162The purpose is to let users quickly find matching commits among published repos,
163like [sample-apiserver](https://github.com/kubernetes/sample-apiserver),
164[apiextension-apiserver](https://github.com/kubernetes/apiextensions-apiserver),
165etc. The Kubernetes version tag does NOT claim any backwards compatibility
166guarantees for client-go. Please check the [semantic versions](#versioning) if
167you care about backwards compatibility.
168
169### How to get it
170
171To get the latest version, use go1.16+ and fetch using the `go get` command. For example:
172
173```
174go get k8s.io/client-go@latest
175```
176
177To get a specific version, use go1.11+ and fetch the desired version using the `go get` command. For example:
178
179```
180go get k8s.io/client-go@v0.20.4
181```
182
183See [INSTALL.md](/INSTALL.md) for detailed instructions and troubleshooting.
184
185### How to use it
186
187If your application runs in a Pod in the cluster, please refer to the
188in-cluster [example](examples/in-cluster-client-configuration), otherwise please
189refer to the out-of-cluster [example](examples/out-of-cluster-client-configuration).
190
191### Dependency management
192
193For details on how to correctly use a dependency management for installing client-go, please see [INSTALL.md](INSTALL.md).
194
195### Contributing code
196Please send pull requests against the client packages in the Kubernetes main [repository](https://github.com/kubernetes/kubernetes). Changes in the staging area will be published to this repository every day.
197