Documentation
¶
Overview ¶
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, services, and minions.
Most consumers should use the Config object to create a Client:
config := &client.Config{
Host: "http://localhost:8080",
Username: "test",
Password: "password",
}
client, err := client.New(&config)
if err != nil {
// handle error
}
client.Pods(ns).List()
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/api-conventions.md`) for a given API path and is intended for use by consumers implementing their own Kubernetes compatible APIs.
Index ¶
- Variables
- func BindClientConfigFlags(flags FlagSet, config *Config)
- func BindKubeletClientConfigFlags(flags FlagSet, config *KubeletConfig)
- func ControllerHasDesiredReplicas(c Interface, controller *api.ReplicationController) wait.ConditionFunc
- func DefaultKubernetesUserAgent() string
- func DefaultServerURL(host, prefix, version string, defaultTLS bool) (*url.URL, error)
- func HTTPWrappersForConfig(config *Config, rt http.RoundTripper) (http.RoundTripper, error)
- func IsConfigTransportTLS(config Config) bool
- func IsTimeout(err error) bool
- func IsUnexpectedStatusError(err error) bool
- func LoadTLSFiles(config *Config) error
- func MatchesServerVersion(c *Config) error
- func NewBasicAuthRoundTripper(username, password string, rt http.RoundTripper) http.RoundTripper
- func NewBearerAuthRoundTripper(bearer string, rt http.RoundTripper) http.RoundTripper
- func NewClientCertTLSConfig(certData, keyData, caData []byte) (*tls.Config, error)
- func NewTLSConfig(caData []byte) (*tls.Config, error)
- func NewUnsafeTLSConfig() *tls.Config
- func NewUserAgentRoundTripper(agent string, rt http.RoundTripper) http.RoundTripper
- func SetKubernetesDefaults(config *Config) error
- func TLSConfigFor(config *Config) (*tls.Config, error)
- func TransportFor(config *Config) (http.RoundTripper, error)
- type APIStatus
- type Client
- func (c *Client) Endpoints(namespace string) EndpointsInterface
- func (c *Client) Events(namespace string) EventInterface
- func (c *Client) LimitRanges(namespace string) LimitRangeInterface
- func (c *Client) Namespaces() NamespaceInterface
- func (c *Client) Nodes() NodeInterface
- func (c *Client) Pods(namespace string) PodInterface
- func (c *Client) ReplicationControllers(namespace string) ReplicationControllerInterface
- func (c *Client) ResourceQuotas(namespace string) ResourceQuotaInterface
- func (c *Client) Secrets(namespace string) SecretsInterface
- func (c *Client) ServerAPIVersions() (*api.APIVersions, error)
- func (c *Client) ServerVersion() (*version.Info, error)
- func (c *Client) Services(namespace string) ServiceInterface
- type Config
- type ConnectionInfoGetter
- type ContainerInfoGetter
- type EndpointsInterface
- type EndpointsNamespacer
- type EventInterface
- type EventNamespacer
- type Fake
- func (c *Fake) Endpoints(namespace string) EndpointsInterface
- func (c *Fake) Events(namespace string) EventInterface
- func (c *Fake) LimitRanges(namespace string) LimitRangeInterface
- func (c *Fake) Namespaces() NamespaceInterface
- func (c *Fake) Nodes() NodeInterface
- func (c *Fake) Pods(namespace string) PodInterface
- func (c *Fake) ReplicationControllers(namespace string) ReplicationControllerInterface
- func (c *Fake) ResourceQuotas(namespace string) ResourceQuotaInterface
- func (c *Fake) Secrets(namespace string) SecretsInterface
- func (c *Fake) ServerAPIVersions() (*api.APIVersions, error)
- func (c *Fake) ServerVersion() (*version.Info, error)
- func (c *Fake) Services(namespace string) ServiceInterface
- type FakeAction
- type FakeEndpoints
- func (c *FakeEndpoints) Create(endpoints *api.Endpoints) (*api.Endpoints, error)
- func (c *FakeEndpoints) Get(name string) (*api.Endpoints, error)
- func (c *FakeEndpoints) List(selector labels.Selector) (*api.EndpointsList, error)
- func (c *FakeEndpoints) Update(endpoints *api.Endpoints) (*api.Endpoints, error)
- func (c *FakeEndpoints) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
- type FakeEvents
- func (c *FakeEvents) Create(event *api.Event) (*api.Event, error)
- func (c *FakeEvents) Delete(name string) error
- func (c *FakeEvents) Get(id string) (*api.Event, error)
- func (c *FakeEvents) GetFieldSelector(involvedObjectName, involvedObjectNamespace, involvedObjectKind, ... *string) fields.Selector
- func (c *FakeEvents) List(label labels.Selector, field fields.Selector) (*api.EventList, error)
- func (c *FakeEvents) Search(objOrRef runtime.Object) (*api.EventList, error)
- func (c *FakeEvents) Update(event *api.Event) (*api.Event, error)
- func (c *FakeEvents) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
- type FakeKubeletClient
- func (c FakeKubeletClient) GetConnectionInfo(host string) (string, uint, http.RoundTripper, error)
- func (c FakeKubeletClient) GetNodeInfo(host string) (api.NodeInfo, error)
- func (c FakeKubeletClient) GetPodStatus(host, podNamespace string, podID string) (api.PodStatusResult, error)
- func (c FakeKubeletClient) HealthCheck(host string) (probe.Result, error)
- type FakeLimitRanges
- func (c *FakeLimitRanges) Create(limitRange *api.LimitRange) (*api.LimitRange, error)
- func (c *FakeLimitRanges) Delete(name string) error
- func (c *FakeLimitRanges) Get(name string) (*api.LimitRange, error)
- func (c *FakeLimitRanges) List(selector labels.Selector) (*api.LimitRangeList, error)
- func (c *FakeLimitRanges) Update(limitRange *api.LimitRange) (*api.LimitRange, error)
- func (c *FakeLimitRanges) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
- type FakeNamespaces
- func (c *FakeNamespaces) Create(namespace *api.Namespace) (*api.Namespace, error)
- func (c *FakeNamespaces) Delete(name string) error
- func (c *FakeNamespaces) Finalize(namespace *api.Namespace) (*api.Namespace, error)
- func (c *FakeNamespaces) Get(name string) (*api.Namespace, error)
- func (c *FakeNamespaces) List(labels labels.Selector, field fields.Selector) (*api.NamespaceList, error)
- func (c *FakeNamespaces) Status(namespace *api.Namespace) (*api.Namespace, error)
- func (c *FakeNamespaces) Update(namespace *api.Namespace) (*api.Namespace, error)
- func (c *FakeNamespaces) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
- type FakeNodes
- func (c *FakeNodes) Create(minion *api.Node) (*api.Node, error)
- func (c *FakeNodes) Delete(id string) error
- func (c *FakeNodes) Get(name string) (*api.Node, error)
- func (c *FakeNodes) List() (*api.NodeList, error)
- func (c *FakeNodes) Update(minion *api.Node) (*api.Node, error)
- func (c *FakeNodes) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
- type FakePods
- func (c *FakePods) Bind(bind *api.Binding) error
- func (c *FakePods) Create(pod *api.Pod) (*api.Pod, error)
- func (c *FakePods) Delete(name string) error
- func (c *FakePods) Get(name string) (*api.Pod, error)
- func (c *FakePods) List(selector labels.Selector) (*api.PodList, error)
- func (c *FakePods) Update(pod *api.Pod) (*api.Pod, error)
- func (c *FakePods) UpdateStatus(pod *api.Pod) (*api.Pod, error)
- func (c *FakePods) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
- type FakeRESTClient
- type FakeReplicationControllers
- func (c *FakeReplicationControllers) Create(controller *api.ReplicationController) (*api.ReplicationController, error)
- func (c *FakeReplicationControllers) Delete(controller string) error
- func (c *FakeReplicationControllers) Get(name string) (*api.ReplicationController, error)
- func (c *FakeReplicationControllers) List(selector labels.Selector) (*api.ReplicationControllerList, error)
- func (c *FakeReplicationControllers) Update(controller *api.ReplicationController) (*api.ReplicationController, error)
- func (c *FakeReplicationControllers) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
- type FakeResourceQuotas
- func (c *FakeResourceQuotas) Create(resourceQuota *api.ResourceQuota) (*api.ResourceQuota, error)
- func (c *FakeResourceQuotas) Delete(name string) error
- func (c *FakeResourceQuotas) Get(name string) (*api.ResourceQuota, error)
- func (c *FakeResourceQuotas) List(selector labels.Selector) (*api.ResourceQuotaList, error)
- func (c *FakeResourceQuotas) Update(resourceQuota *api.ResourceQuota) (*api.ResourceQuota, error)
- func (c *FakeResourceQuotas) UpdateStatus(resourceQuota *api.ResourceQuota) (*api.ResourceQuota, error)
- func (c *FakeResourceQuotas) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
- type FakeSecrets
- func (c *FakeSecrets) Create(secret *api.Secret) (*api.Secret, error)
- func (c *FakeSecrets) Delete(secret string) error
- func (c *FakeSecrets) Get(name string) (*api.Secret, error)
- func (c *FakeSecrets) List(labels labels.Selector, field fields.Selector) (*api.SecretList, error)
- func (c *FakeSecrets) Update(secret *api.Secret) (*api.Secret, error)
- func (c *FakeSecrets) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
- type FakeServices
- func (c *FakeServices) Create(service *api.Service) (*api.Service, error)
- func (c *FakeServices) Delete(service string) error
- func (c *FakeServices) Get(name string) (*api.Service, error)
- func (c *FakeServices) List(selector labels.Selector) (*api.ServiceList, error)
- func (c *FakeServices) Update(service *api.Service) (*api.Service, error)
- func (c *FakeServices) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
- type FlagSet
- type HTTPClient
- type HTTPClientFunc
- type HTTPContainerInfoGetter
- func (self *HTTPContainerInfoGetter) GetContainerInfo(host, podID, containerID string, req *cadvisorApi.ContainerInfoRequest) (*cadvisorApi.ContainerInfo, error)
- func (self *HTTPContainerInfoGetter) GetMachineInfo(host string) (*cadvisorApi.MachineInfo, error)
- func (self *HTTPContainerInfoGetter) GetRootInfo(host string, req *cadvisorApi.ContainerInfoRequest) (*cadvisorApi.ContainerInfo, error)
- type HTTPKubeletClient
- func (c *HTTPKubeletClient) GetConnectionInfo(host string) (string, uint, http.RoundTripper, error)
- func (c *HTTPKubeletClient) GetNodeInfo(host string) (api.NodeInfo, error)
- func (c *HTTPKubeletClient) GetPodStatus(host, podNamespace, podID string) (api.PodStatusResult, error)
- func (c *HTTPKubeletClient) HealthCheck(host string) (probe.Result, error)
- type Interface
- type KubeletClient
- type KubeletConfig
- type KubeletHealthChecker
- type LimitRangeInterface
- type LimitRangesNamespacer
- type NamespaceInterface
- type NamespacesInterface
- type NodeInfoGetter
- type NodeInterface
- type NodesInterface
- type PodInfoGetter
- type PodInterface
- type PodsNamespacer
- type RESTClient
- type ReplicationControllerInterface
- type ReplicationControllersNamespacer
- type Request
- func (r *Request) AbsPath(segments ...string) *Request
- func (r *Request) Body(obj interface{}) *Request
- func (r *Request) Do() Result
- func (r *Request) DoRaw() ([]byte, error)
- func (r *Request) FieldsSelectorParam(paramName string, s fields.Selector) *Request
- func (r *Request) LabelsSelectorParam(paramName string, s labels.Selector) *Request
- func (r *Request) Name(resourceName string) *Request