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

..03-May-2022-

.github/H13-Mar-2019-43

Godeps/H13-Mar-2019-662656

deprecated-dynamic/H13-Mar-2019-959743

discovery/H13-Mar-2019-3,2202,465

dynamic/H13-Mar-2019-2,5401,979

examples/H13-Mar-2019-941583

informers/H13-Mar-2019-10,1355,646

kubernetes/H13-Mar-2019-35,09721,444

kubernetes_test/H13-Mar-2019-6139

listers/H13-Mar-2019-9,9634,906

pkg/H13-Mar-2019-1,429707

plugin/pkg/client/auth/H13-Mar-2019-3,5512,797

rest/H13-Mar-2019-6,2114,775

restmapper/H13-Mar-2019-1,6311,283

scale/H13-Mar-2019-2,4281,406

testing/H13-Mar-2019-1,8901,407

third_party/forked/golang/template/H13-Mar-2019-695560

tools/H13-Mar-2019-23,79316,790

transport/H13-Mar-2019-2,3821,832

util/H13-Mar-2019-9,5307,138

.travis.ymlH A D13-Mar-201991 106

CHANGELOG.mdH A D13-Mar-201942.9 KiB880519

CONTRIBUTING.mdH A D13-Mar-2019793 106

INSTALL.mdH A D13-Mar-20196.3 KiB163124

LICENSEH A D13-Mar-201911.1 KiB203169

OWNERSH A D13-Mar-2019245 2018

README.mdH A D13-Mar-201911 KiB196150

SECURITY_CONTACTSH A D13-Mar-2019562 1816

code-of-conduct.mdH A D13-Mar-2019148 42

README.md

1# client-go
2
3Go clients for talking to a [kubernetes](http://kubernetes.io/) cluster.
4
5We currently recommend using the v10.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.7 | Kubernetes 1.8 | Kubernetes 1.9 | Kubernetes 1.10 | Kubernetes 1.11 | Kubernetes 1.12 | Kubernetes 1.13 |
96|---------------------|----------------|----------------|----------------|-----------------|-----------------|-----------------|-----------------|
97| client-go 4.0       | ✓              | +-             | +-             | +-              | +-              | +-              | +-              |
98| client-go 5.0       | +-             | ✓              | +-             | +-              | +-              | +-              | +-              |
99| client-go 6.0       | +-             | +-             | ✓              | +-              | +-              | +-              | +-              |
100| client-go 7.0       | +-             | +-             | +-             | ✓               | +-              | +-              | +-              |
101| client-go 8.0       | +-             | +-             | +-             | +-              | ✓               | +-              | +-              |
102| client-go 9.0       | +-             | +-             | +-             | +-              | +-              | ✓               | +-              |
103| client-go 10.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 HEAD | Kubernetes main repo, master branch  | ✓                             |
137
138Key:
139
140* `✓` Changes in main Kubernetes repo are actively published to client-go by a bot
141* `=` Maintenance is manual, only severe security bugs will be patched.
142* `-` Deprecated; please upgrade.
143
144#### Deprecation policy
145
146We will maintain branches for at least six months after their first stable tag
147is cut. (E.g., the clock for the release-2.0 branch started ticking when we
148tagged v2.0.0, not when we made the first alpha.) This policy applies to
149every version greater than or equal to 2.0.
150
151#### Why do the 1.4 and 1.5 branch contain top-level folder named after the version?
152
153For the initial release of client-go, we thought it would be easiest to keep
154separate directories for each minor version. That soon proved to be a mistake.
155We are keeping the top-level folders in the 1.4 and 1.5 branches so that
156existing users won't be broken.
157
158### Kubernetes tags
159
160This repository is still a mirror of
161[k8s.io/kubernetes/staging/src/client-go](https://github.com/kubernetes/kubernetes/tree/master/staging/src/k8s.io/client-go),
162the code development is still done in the staging area. Since Kubernetes 1.8
163release, when syncing the code from the staging area, we also sync the Kubernetes
164version tags to client-go, prefixed with "kubernetes-". For example, if you check
165out the `kubernetes-v1.8.0` tag in client-go, the code you get is exactly the
166same as if you check out the `v1.8.0` tag in kubernetes, and change directory to
167`staging/src/k8s.io/client-go`. The purpose is to let users quickly find matching
168commits among published repos, like
169[sample-apiserver](https://github.com/kubernetes/sample-apiserver),
170[apiextension-apiserver](https://github.com/kubernetes/apiextensions-apiserver),
171etc. The Kubernetes version tag does NOT claim any backwards compatibility
172guarantees for client-go. Please check the [semantic versions](#versioning) if
173you care about backwards compatibility.
174
175### How to get it
176
177You can use `go get k8s.io/client-go/...` to get client-go, but **you will get
178the unstable master branch** and `client-go`'s vendored dependencies will not be
179added to your `$GOPATH`. So we think most users will want to use a dependency
180management system. See [INSTALL.md](/INSTALL.md) for detailed instructions.
181
182### How to use it
183
184If your application runs in a Pod in the cluster, please refer to the
185in-cluster [example](examples/in-cluster-client-configuration), otherwise please
186refer to the out-of-cluster [example](examples/out-of-cluster-client-configuration).
187
188### Dependency management
189
190If your application depends on a package that client-go depends on, and you let the Go compiler find the dependency in `GOPATH`, you will end up with duplicated dependencies: one copy from the `GOPATH`, and one from the vendor folder of client-go. This will cause unexpected runtime error like flag redefinition, since the go compiler ends up importing both packages separately, even if they are exactly the same thing. If this happens, you can either
191* run `godep restore` ([godep](https://github.com/tools/godep)) in the client-go/ folder, then remove the vendor folder of client-go. Then the packages in your GOPATH will be the only copy
192* or run `godep save` in your application folder to flatten all dependencies.
193
194### Contributing code
195Please 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.
196