top

Package client contains the implementation of the client side communication with the Kubernetes master. The Client class provides methods for reading, creating, updating, and deleting pods, replication controllers, daemons, services, and nodes.

Most consumers should use the Config object to create a Client:

import (
  "k8s.io/kubernetes/pkg/client"
  "k8s.io/kubernetes/pkg/api"
  "k8s.io/kubernetes/pkg/fields"
  "k8s.io/kubernetes/pkg/labels"
)

[...]

config := &client.Config{
  Host:     "http://localhost:8080",
  Username: "test",
  Password: "password",
}
client, err := client.New(config)
if err != nil {
  // handle error
}
pods, err := client.Pods(api.NamespaceDefault).List(labels.Everything(), fields.Everything())
if err != nil {
  // handle error
}

More advanced consumers may wish to provide their own transport via a http.RoundTripper:

config := &client.Config{
  Host:      "https://localhost:8080",
  Transport: oauthclient.Transport(),
}
client, err := client.New(config)

The RESTClient type implements the Kubernetes API conventions (see `docs/devel/api-conventions.md`) for a given API path and is intended for use by consumers implementing their own Kubernetes compatible APIs.

Imports 22 package(s)

  1. k8s.io/kubernetes/pkg/watch
  2. k8s.io/kubernetes/pkg/runtime
  3. k8s.io/kubernetes/pkg/api/install
  4. k8s.io/kubernetes/pkg/api
  5. github.com/emicklei/go-restful/swagger
  6. k8s.io/kubernetes/pkg/version
  7. github.com/google/cadvisor/info/v1
  8. k8s.io/kubernetes/pkg/fields
  9. k8s.io/kubernetes/pkg/api/meta
  10. k8s.io/kubernetes/pkg/client/metrics
  11. k8s.io/kubernetes/pkg/api/errors
  12. k8s.io/kubernetes/pkg/apis/experimental/install
  13. k8s.io/kubernetes/pkg/api/latest
  14. k8s.io/kubernetes/pkg/util/wait
  15. k8s.io/kubernetes/pkg/util
  16. k8s.io/kubernetes/pkg/watch/json
  17. k8s.io/kubernetes/pkg/labels
  18. k8s.io/kubernetes/pkg/util/httpstream
  19. k8s.io/kubernetes/pkg/util/sets
  20. k8s.io/kubernetes/pkg/apis/experimental
  21. github.com/golang/glog
  22. k8s.io/kubernetes/pkg/api/unversioned

Test imports 6 package(s)

  1. k8s.io/kubernetes/pkg/client/unversioned
  2. k8s.io/kubernetes/pkg/api/testapi
  3. k8s.io/kubernetes/pkg/probe
  4. k8s.io/kubernetes/pkg/api/resource
  5. k8s.io/kubernetes/pkg/client/unversioned/fake
  6. github.com/google/cadvisor/info/v1/test