kube

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerInfo

type ContainerInfo struct {
	Name string

	CpuMax        *CpuResource
	CpuMaxTime    time.Time
	MemoryMax     *MemoryResource
	MemoryMaxTime time.Time

	*ContainerStatus
	*ContainerUsage
}

type ContainerMaxes

type ContainerMaxes struct {
	CpuMax        *CpuResource
	CpuMaxTime    time.Time
	MemoryMax     *MemoryResource
	MemoryMaxTime time.Time
}

type ContainerResources

type ContainerResources struct {
	Name               string
	Namespace          string
	CpuReq             *CpuResource
	CpuLimit           *CpuResource
	PercentCpuReq      int
	PercentCpuLimit    int
	MemReq             *MemoryResource
	MemLimit           *MemoryResource
	PercentMemoryReq   int
	PercentMemoryLimit int
}

type ContainerStatus

type ContainerStatus struct {
	Name     string
	Status   string
	Ready    bool
	Restarts int
	Age      time.Time
}

type ContainerUsage

type ContainerUsage struct {
	Name        string
	CpuUsage    *CpuResource
	MemoryUsage *MemoryResource
}

type CpuResource

type CpuResource struct {
	*resource.Quantity
}

func NewCpuResource

func NewCpuResource(value int64) *CpuResource

func (*CpuResource) String

func (r *CpuResource) String() string

type KubeClient

type KubeClient struct {
	// contains filtered or unexported fields
}

func NewKubeClient

func NewKubeClient(
	clientset *kubernetes.Clientset,
) *KubeClient

func (*KubeClient) ClusterCapacity

func (k *KubeClient) ClusterCapacity() (capacity api_v1.ResourceList, err error)

Return the total cluster capacity as a ResourceList

func (*KubeClient) ContainerResources

func (k *KubeClient) ContainerResources(namespace string) (resources []*ContainerResources, err error)

Return the resources in use by containers in the cluster as list of ContainerResources

func (*KubeClient) Containers

func (k *KubeClient) Containers(namespace string) ([]*ContainerInfo, error)

func (*KubeClient) Events

func (k *KubeClient) Events(namespace string) ([]api_v1.Event, error)

Returns events from the specified namespace sorted by timestamp

func (*KubeClient) NodeContainerResources

func (k *KubeClient) NodeContainerResources(namespace, nodeName string) (resources []*ContainerResources, err error)

Return a list of container resources for all containers running on the specified node

func (*KubeClient) NodeResources

func (k *KubeClient) NodeResources(node *api_v1.Node, namespace string) (*NodeResources, error)

Return NodeResources struct for the specified object.

func (*KubeClient) Nodes

func (k *KubeClient) Nodes() ([]api_v1.Node, error)

Returns nodes in the cluster

type MemoryResource

type MemoryResource struct {
	*resource.Quantity
}

func NewMemoryResource

func NewMemoryResource(value int64) *MemoryResource

func (*MemoryResource) String

func (r *MemoryResource) String() string

type NodeResources

type NodeResources struct {
	Name           string
	Pods           int
	CpuUsage       *CpuResource
	CpuCapacity    *CpuResource
	PercentCpu     int
	MemoryUsage    *MemoryResource
	MemoryCapacity *MemoryResource
	PercentMemory  int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL