Documentation
¶
Overview ¶
Package unversioned 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 (
client "k8s.io/kubernetes/pkg/client/unversioned"
"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.
Index ¶
- Constants
- Variables
- func ControllerHasDesiredReplicas(c Interface, controller *api.ReplicationController) wait.ConditionFunc
- func DeploymentHasDesiredReplicas(c ExtensionsInterface, deployment *extensions.Deployment) wait.ConditionFunc
- func GetInvolvedObjectNameFieldLabel(version string) string
- func IsTimeout(err error) bool
- func JobHasDesiredParallelism(c ExtensionsInterface, job *extensions.Job) wait.ConditionFunc
- func MatchesServerVersion(client *Client, c *restclient.Config) error
- func NegotiateVersion(client *Client, c *restclient.Config, requestedGV *unversioned.GroupVersion, ...) (*unversioned.GroupVersion, error)
- func ReplicaSetHasDesiredReplicas(c ExtensionsInterface, replicaSet *extensions.ReplicaSet) wait.ConditionFunc
- func RetryOnConflict(backoff wait.Backoff, fn func() error) error
- func SetKubernetesDefaults(config *restclient.Config) error
- type AutoscalingClient
- type AutoscalingInterface
- type BatchClient
- type BatchInterface
- type Client
- func (c *Client) Autoscaling() AutoscalingInterface
- func (c *Client) Batch() BatchInterface
- func (c *Client) ComponentStatuses() ComponentStatusInterface
- func (c *Client) ConfigMaps(namespace string) ConfigMapsInterface
- func (c *Client) Discovery() discovery.DiscoveryInterface
- func (c *Client) Endpoints(namespace string) EndpointsInterface
- func (c *Client) Events(namespace string) EventInterface
- func (c *Client) Extensions() ExtensionsInterface
- func (c *Client) LimitRanges(namespace string) LimitRangeInterface
- func (c *Client) Namespaces() NamespaceInterface
- func (c *Client) Nodes() NodeInterface
- func (c *Client) PersistentVolumeClaims(namespace string) PersistentVolumeClaimInterface
- func (c *Client) PersistentVolumes() PersistentVolumeInterface
- func (c *Client) PodTemplates(namespace string) PodTemplateInterface
- 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) ServiceAccounts(namespace string) ServiceAccountsInterface
- func (c *Client) Services(namespace string) ServiceInterface
- type ComponentStatusInterface
- type ComponentStatusesInterface
- type ConfigMaps
- func (c *ConfigMaps) Create(cfg *api.ConfigMap) (*api.ConfigMap, error)
- func (c *ConfigMaps) Delete(name string) error
- func (c *ConfigMaps) Get(name string) (*api.ConfigMap, error)
- func (c *ConfigMaps) List(opts api.ListOptions) (*api.ConfigMapList, error)
- func (c *ConfigMaps) Update(cfg *api.ConfigMap) (*api.ConfigMap, error)
- func (c *ConfigMaps) Watch(opts api.ListOptions) (watch.Interface, error)
- type ConfigMapsInterface
- type ConfigMapsNamespacer
- type ContainerInfoGetter
- type DaemonSetInterface
- type DaemonSetsNamespacer
- type DeploymentInterface
- type DeploymentsNamespacer
- type EndpointsInterface
- type EndpointsNamespacer
- type EventInterface
- type EventNamespacer
- type ExtensionsClient
- func (c *ExtensionsClient) DaemonSets(namespace string) DaemonSetInterface
- func (c *ExtensionsClient) Deployments(namespace string) DeploymentInterface
- func (c *ExtensionsClient) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface
- func (c *ExtensionsClient) Ingress(namespace string) IngressInterface
- func (c *ExtensionsClient) Jobs(namespace string) JobInterface
- func (c *ExtensionsClient) PodSecurityPolicies() PodSecurityPolicyInterface
- func (c *ExtensionsClient) ReplicaSets(namespace string) ReplicaSetInterface
- func (c *ExtensionsClient) Scales(namespace string) ScaleInterface
- func (c *ExtensionsClient) ThirdPartyResources(namespace string) ThirdPartyResourceInterface
- type ExtensionsInterface
- type FlagSet
- 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 HorizontalPodAutoscalerInterface
- type HorizontalPodAutoscalersNamespacer
- type IngressInterface
- type IngressNamespacer
- type Interface
- type JobInterface
- type JobsNamespacer
- type LimitRangeInterface
- type LimitRangesNamespacer
- type NamespaceInterface
- type NamespacesInterface
- type NodeInterface
- type NodesInterface
- type PersistentVolumeClaimInterface
- type PersistentVolumeClaimsNamespacer
- type PersistentVolumeInterface
- type PersistentVolumesInterface
- type PodInterface
- type PodSecurityPoliciesInterface
- type PodSecurityPolicyInterface
- type PodTemplateInterface
- type PodTemplatesNamespacer
- type PodsNamespacer
- type ReplicaSetInterface
- type ReplicaSetsNamespacer
- type ReplicationControllerInterface
- type ReplicationControllersNamespacer
- type ResourceQuotaInterface
- type ResourceQuotasNamespacer
- type ScaleInterface
- type ScaleNamespacer
- type SecretsInterface
- type SecretsNamespacer
- type ServiceAccountsInterface
- type ServiceAccountsNamespacer