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

..03-May-2022-

.github/H20-Jun-2019-

Godeps/H20-Jun-2019-

deprecated-dynamic/H20-Jun-2019-

discovery/H20-Jun-2019-

dynamic/H20-Jun-2019-

examples/H20-Jun-2019-

informers/H20-Jun-2019-

kubernetes/H20-Jun-2019-

kubernetes_test/H20-Jun-2019-

listers/H20-Jun-2019-

pkg/H20-Jun-2019-

plugin/pkg/client/auth/H20-Jun-2019-

rest/H20-Jun-2019-

restmapper/H20-Jun-2019-

scale/H20-Jun-2019-

testing/H20-Jun-2019-

third_party/forked/golang/template/H20-Jun-2019-

tools/H20-Jun-2019-

transport/H20-Jun-2019-

util/H20-Jun-2019-

CHANGELOG.mdH A D20-Jun-201942.9 KiB

CONTRIBUTING.mdH A D20-Jun-2019793

INSTALL.mdH A D20-Jun-20197.7 KiB

LICENSEH A D20-Jun-201911.1 KiB

OWNERSH A D20-Jun-2019245

README.mdH A D20-Jun-201910.5 KiB

SECURITY_CONTACTSH A D20-Jun-2019562

code-of-conduct.mdH A D20-Jun-2019148

go.modH A D20-Jun-20191.8 KiB

go.sumH A D20-Jun-20199.9 KiB

README.md

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