Documentation
¶
Index ¶
- type Client
- func (c *Client) ActiveCluster() string
- func (c *Client) ActiveNamespace() string
- func (c *Client) ClusterHasMetrics() (bool, error)
- func (c *Client) Dial() (kubernetes.Interface, error)
- func (c *Client) DialOrDie() kubernetes.Interface
- func (c *Client) DialVersioned() (*versioned.Clientset, error)
- func (c *Client) IsActiveNamespace(ns string) bool
- func (c *Client) RESTConfig() (*rest.Config, error)
- func (c *Client) RawConfig() (clientcmdapi.Config, error)
- type ContainerMetrics
- type Metrics
- type NodeMetrics
- type NodesMetrics
- type PodsMetrics
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 represents an api server client.
func NewClient ¶
func NewClient(flags *config.Flags) *Client
NewClient create Kubernetes apiservice client.
func (*Client) ActiveCluster ¶ added in v0.2.0
func (c *Client) ActiveCluster() string
ActiveCluster get the current cluster name.
func (*Client) ActiveNamespace ¶ added in v0.2.0
func (c *Client) ActiveNamespace() string
ActiveNamespace returns the active namespace from the args or kubeconfig. It returns all namespace is none is found.
func (*Client) ClusterHasMetrics ¶
func (c *Client) ClusterHasMetrics() (bool, error)
ClusterHasMetrics checks if metrics server is available on the cluster.
func (*Client) Dial ¶
func (c *Client) Dial() (kubernetes.Interface, error)
Dial returns a handle to api server.
func (*Client) DialOrDie ¶
func (c *Client) DialOrDie() kubernetes.Interface
DialOrDie returns an api server client connection or dies.
func (*Client) DialVersioned ¶ added in v0.3.4
func (c *Client) DialVersioned() (*versioned.Clientset, error)
DialVersioned connects to the versioned client to pull cluster metrics.
func (*Client) IsActiveNamespace ¶ added in v0.3.4
func (c *Client) IsActiveNamespace(ns string) bool
IsActiveNamespace check if current ns is equal to specified namespace if a namespace is set.
func (*Client) RESTConfig ¶ added in v0.2.0
func (c *Client) RESTConfig() (*rest.Config, error)
RESTConfig fetch the current REST api-server connection.
type ContainerMetrics ¶
type ContainerMetrics map[string]Metrics
ContainerMetrics tracks container metrics
type Metrics ¶
type Metrics struct {
CurrentCPU resource.Quantity
CurrentMEM resource.Quantity
}
Metrics represent an aggregation of all pod containers metrics.
type NodeMetrics ¶
type NodeMetrics struct {
CurrentCPU resource.Quantity
CurrentMEM resource.Quantity
AvailableCPU resource.Quantity
AvailableMEM resource.Quantity
TotalCPU resource.Quantity
TotalMEM resource.Quantity
}
NodeMetrics describes raw node metrics.
type NodesMetrics ¶
type NodesMetrics map[string]NodeMetrics
NodesMetrics tracks usage metrics per nodes.
type PodsMetrics ¶
type PodsMetrics map[string]ContainerMetrics
PodsMetrics tracks usage metrics per pods.