Documentation
¶
Index ¶
- type Client
- func (k *Client) Clientset() kubernetes.Interface
- func (k *Client) Cluster() string
- func (k *Client) Context() string
- func (k *Client) GetPod(namespace string, name string) (*Pod, error)
- func (k *Client) GetVersionInfo() (*version.Info, error)
- func (k *Client) ListPods(namespace string, labelSelector, fieldSelector string) (list []*Pod, err error)
- func (k *Client) Namespace() string
- func (k *Client) String() string
- type Config
- func (c *Config) ClusterNames() ([]string, error)
- func (c *Config) ConfigAccess() (clientcmd.ConfigAccess, error)
- func (c *Config) ContextNames() ([]string, error)
- func (c *Config) Contexts() (map[string]*clientcmdapi.Context, error)
- func (c *Config) CurrentCluster() (string, error)
- func (c *Config) CurrentContext() (string, error)
- func (c *Config) CurrentNamespace() (string, error)
- func (c *Config) GetContext(name string) (*clientcmdapi.Context, error)
- func (c *Config) RESTConfig() (*restclient.Config, error)
- func (c *Config) RawConfig() (clientcmdapi.Config, error)
- type Pod
- func (pod Pod) Age() time.Duration
- func (pod Pod) Exec(command string, stdin io.Reader, stdout, stderr io.Writer) error
- func (pod Pod) ExecContainer(container, command string, stdin io.Reader, stdout, stderr io.Writer) error
- func (pod Pod) PortForward(podPort int) (*PortForwarder, error)
- func (pod Pod) String() string
- type PortForwardOptions
- type PortForwarder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for interacting with Kubernetes API for a single master.
func (*Client) Clientset ¶
func (k *Client) Clientset() kubernetes.Interface
Clientset returns interface for kubernetes API.
func (*Client) ListPods ¶
func (k *Client) ListPods(namespace string, labelSelector, fieldSelector string) (list []*Pod, err error)
ListPods calls the API to lists all pods with namespace and label selector.
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func NewConfig ¶
func NewConfig(flags *genericclioptions.ConfigFlags) *Config
func NewConfigWith ¶
func (*Config) ClusterNames ¶
func (*Config) ConfigAccess ¶
func (c *Config) ConfigAccess() (clientcmd.ConfigAccess, error)
func (*Config) ContextNames ¶
func (*Config) CurrentCluster ¶
func (*Config) CurrentContext ¶
func (*Config) CurrentNamespace ¶
func (*Config) GetContext ¶
func (c *Config) GetContext(name string) (*clientcmdapi.Context, error)
func (*Config) RESTConfig ¶
func (c *Config) RESTConfig() (*restclient.Config, error)
type Pod ¶
type Pod struct { UID types.UID Name string NodeName string Cluster string Namespace string IP string HostIP string Created time.Time URL string Image string ImageID string // contains filtered or unexported fields }
Pod is a pod returned from Client.
func (Pod) ExecContainer ¶
func (pod Pod) ExecContainer(container, command string, stdin io.Reader, stdout, stderr io.Writer) error
ExecContainer executes a command in a container of the pod.
func (Pod) PortForward ¶
func (pod Pod) PortForward(podPort int) (*PortForwarder, error)
PortForward starts port forwarding of pod port to a local random port.
type PortForwardOptions ¶
type PortForwarder ¶
type PortForwarder struct { Streams genericclioptions.IOStreams // contains filtered or unexported fields }
func PortForward ¶
func PortForward(client *Client, opt PortForwardOptions) (*PortForwarder, error)
PortForward starts port forwarding for a port and returns the PortForwarder.
func (*PortForwarder) Done ¶ added in v0.2.0
func (pf *PortForwarder) Done() <-chan error
func (*PortForwarder) LocalPort ¶
func (pf *PortForwarder) LocalPort() uint16
func (*PortForwarder) Stop ¶
func (pf *PortForwarder) Stop()
Click to show internal directories.
Click to hide internal directories.