Documentation ¶
Index ¶
- Constants
- func GetContainersByNode(pods []kapi.Pod) map[string]int
- func RangePods(pods []kapi.Pod, fn func(kapi.Pod) bool) error
- type Container
- type ContainerResources
- type ContainerResourcesRequirements
- type Kube
- func (kube *Kube) GetCronJobs() (*kbeta1.CronJobList, error)
- func (kube *Kube) GetDaemonSets() (*kbeta2.DaemonSetList, error)
- func (kube *Kube) GetDeployments() (*kbeta2.DeploymentList, error)
- func (kube *Kube) GetLimitRanges() (*kv1.LimitRangeList, error)
- func (kube *Kube) GetNodes() (*kv1.NodeList, error)
- func (kube *Kube) GetPods() (*kv1.PodList, error)
- func (kube *Kube) GetReplicaSets() (*kbeta2.ReplicaSetList, error)
- func (kube *Kube) GetReplicationControllers() (*kv1.ReplicationControllerList, error)
- func (kube *Kube) GetResources() (pods []kv1.Pod, limitRanges []kv1.LimitRange, resources []Resource, ...)
- func (kube *Kube) GetStatefulSet(namespace, name string) (*v1.StatefulSet, error)
- func (kube *Kube) GetStatefulSets() (*kbeta2.StatefulSetList, error)
- func (kube *Kube) SetResources(kind string, name string, namespace string, totalResources TotalResources) (skipped bool, err error)
- type Node
- type NodeCapacity
- type RawResources
- type RequestLimit
- type Resource
- type TotalResources
Constants ¶
View Source
const NodeRoleLabelPrefix = "node-role.kubernetes.io/"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Container ¶
type Container struct { // cluster where host of container located in Cluster string `json:"cluster,omitempty"` // image of container Image string `json:"image"` // limits of container Limits *ContainerResources `json:"limits,omitempty"` // requests of container Requests *ContainerResources `json:"requests,omitempty"` // name of container (not guaranteed to be unique in cluster scope) Name string `json:"name"` // namespace where pod located in Namespace string `json:"namespace"` // node where container located in Node string `json:"node"` // pod where container located in Pod string `json:"pod"` }
Container user type.
type ContainerResources ¶
ContainerResources user type.
type ContainerResourcesRequirements ¶
type ContainerResourcesRequirements struct { Name string Requests RequestLimit Limits RequestLimit }
ContainerResources container resources
type Kube ¶
type Kube struct { Clientset *kubernetes.Clientset ClientV1Beta2 *beta2client.AppsV1beta2Client ClientBatch *batch.BatchV1beta1Client // contains filtered or unexported fields }
Kube kube struct
func InitKubernetes ¶
func (*Kube) GetCronJobs ¶
func (kube *Kube) GetCronJobs() ( *kbeta1.CronJobList, error, )
GetCronJobs get cron jobs
func (*Kube) GetDaemonSets ¶
func (kube *Kube) GetDaemonSets() ( *kbeta2.DaemonSetList, error, )
GetDaemonSets get daemon sets
func (*Kube) GetDeployments ¶
func (kube *Kube) GetDeployments() (*kbeta2.DeploymentList, error)
GetDeployments get deployments
func (*Kube) GetLimitRanges ¶
func (kube *Kube) GetLimitRanges() ( *kv1.LimitRangeList, error, )
GetLimitRanges get limits and ranges for namespaces
func (*Kube) GetReplicaSets ¶
func (kube *Kube) GetReplicaSets() ( *kbeta2.ReplicaSetList, error, )
GetReplicaSets get replicasets
func (*Kube) GetReplicationControllers ¶
func (kube *Kube) GetReplicationControllers() ( *kv1.ReplicationControllerList, error, )
GetReplicationControllers get replication controllers
func (*Kube) GetResources ¶
func (*Kube) GetStatefulSet ¶
func (kube *Kube) GetStatefulSet(namespace, name string) ( *v1.StatefulSet, error, )
func (*Kube) GetStatefulSets ¶
func (kube *Kube) GetStatefulSets() ( *kbeta2.StatefulSetList, error, )
GetStatefulSets get statuful sets
func (*Kube) SetResources ¶
func (kube *Kube) SetResources( kind string, name string, namespace string, totalResources TotalResources, ) (skipped bool, err error)
SetResources set resources for a service
type Node ¶
type Node struct { ID uuid.UUID `json:"id,omitempty"` Name string `json:"name"` IP string `json:"ip"` Roles string `json:"roles"` KubeletPort int32 `json:"port"` Provider string `json:"provider,omitempty"` Region string `json:"region,omitempty"` InstanceType string `json:"instance_type,omitempty"` InstanceSize string `json:"instance_size,omitempty"` Capacity NodeCapacity `json:"capacity"` Allocatable NodeCapacity `json:"allocatable"` Containers int `json:"containers,omitempty"` ContainerList []*Container `json:"container_list,omitempty"` }
func AddContainerListToNodes ¶
type NodeCapacity ¶
type NodeCapacity struct { CPU int `json:"cpu"` Memory int `json:"memory"` StorageEphemeral int `json:"storage_ephemeral"` Pods int `json:"pods"` }
func GetNodeCapacity ¶
func GetNodeCapacity(resources kapi.ResourceList) NodeCapacity
type RawResources ¶
type RawResources struct { PodList *kv1.PodList LimitRangeList *kv1.LimitRangeList CronJobList *kbeta1.CronJobList DeploymentList *kbeta2.DeploymentList StatefulSetList *kbeta2.StatefulSetList DaemonSetList *kbeta2.DaemonSetList ReplicaSetList *kbeta2.ReplicaSetList }
type RequestLimit ¶
RequestLimit request limit
type TotalResources ¶
type TotalResources struct { Replicas *int Containers []ContainerResourcesRequirements }
TotalResources service resources and replicas
Click to show internal directories.
Click to hide internal directories.