bakins / k8s-client

Simple Kubernetes client for Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

k8s-client GoDoc

k8s-client is a Kubernetes client for Go.

Notice

Master should not be considered stable. Please vendor a tagged version. I will be making breaking changes to the API. Also import paths have changed to github.com/bakins/k8s-client

Status

k8s-client should be considered alpha quality. The API is subject to change.

k8s-client does not have 100% coverage of the Kubenretes API, but supports the common operations. Submit an issue or PR for support of others.

Motivation

The "official" Kubernetes client for Go is part of the Kubernetes project proper and lives within the main Kubernetes repository. It also requires a rather large number of dependencies.

k8s-client is a small simple API client.

License

Apache 2 License

k8s-client also includes parts of the Kubernetes code that is also under the Apache 2 License.

Usage

See GoDoc for documentation.

Testing

To test the included Kubernetes http client, I use minikube to start a local cluster. Then I run kubectl proxy to proxy to the local cluster without authentication (this makes testing easier). Then:

cd http
go test -v

The tests will try to connect to Kubernetes at http://127.0.0.1:8001. This can be overriden using the K8S_SERVER environment value.

TODO

  • Mock client for testing
  • Better docs/examples
  • Support all the Kubernetes types and operations
  • Support watches

About

Simple Kubernetes client for Go

License:Apache License 2.0


Languages

Language:Go 97.5%Language:Shell 2.5%