node

package
v0.0.0-...-1dfee00 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectionCordonNode

func CollectionCordonNode(client *kubernetes.Clientset, nodeName []string) error

func CollectionNodeUnschedule

func CollectionNodeUnschedule(client *kubernetes.Clientset, nodeName []string) error

func CordonNode

func CordonNode(client *kubernetes.Clientset, nodeName string) (bool, error)

func GetNodeResource

func GetNodeResource(client *kubernetes.Clientset) (namespaces int, deployments int, pods int)

func NodeUnschdulable

func NodeUnschdulable(client *kubernetes.Clientset, nodeName string, unschdulable bool) (bool, error)

func PodRequestsAndLimits

func PodRequestsAndLimits(pod *v1.Pod) (reqs, limits v1.ResourceList, err error)

PodRequestsAndLimits returns a dictionary of all defined resources summed up for all containers of the pod. If pod overhead is non-nil, the pod overhead is added to the total container resource requests and to the total container limits which have a non-zero quantity.

func RemoveNode

func RemoveNode(client *kubernetes.Clientset, nodeName string) (bool, error)

Types

type Node

type Node struct {
	ObjectMeta         k8s.ObjectMeta             `json:"objectMeta"`
	TypeMeta           k8s.TypeMeta               `json:"typeMeta"`
	Ready              v1.ConditionStatus         `json:"ready"`
	Unschedulable      k8s.Unschedulable          `json:"unschedulable"`
	NodeIP             k8s.NodeIP                 `json:"nodeIP"`
	AllocatedResources k8s.NodeAllocatedResources `json:"allocatedResources"`
	NodeInfo           v1.NodeSystemInfo          `json:"nodeInfo"`
}

Node is a presentation layer view of Kubernetes nodes. This means it is node plus additional augmented data we can get from other sources.

type NodeAllocatedResources

type NodeAllocatedResources struct {
	// CPURequests is number of allocated milicores.
	CPURequests int64 `json:"cpuRequests"`

	// CPURequestsFraction is a fraction of CPU, that is allocated.
	CPURequestsFraction float64 `json:"cpuRequestsFraction"`

	// CPULimits is defined CPU limit.
	CPULimits int64 `json:"cpuLimits"`

	// CPULimitsFraction is a fraction of defined CPU limit, can be over 100%, i.e.
	// overcommitted.
	CPULimitsFraction float64 `json:"cpuLimitsFraction"`

	// CPUCapacity is specified node CPU capacity in milicores.
	CPUCapacity int64 `json:"cpuCapacity"`

	// MemoryRequests is a fraction of memory, that is allocated.
	MemoryRequests int64 `json:"memoryRequests"`

	// MemoryRequestsFraction is a fraction of memory, that is allocated.
	MemoryRequestsFraction float64 `json:"memoryRequestsFraction"`

	// MemoryLimits is defined memory limit.
	MemoryLimits int64 `json:"memoryLimits"`

	// MemoryLimitsFraction is a fraction of defined memory limit, can be over 100%, i.e.
	// overcommitted.
	MemoryLimitsFraction float64 `json:"memoryLimitsFraction"`

	// MemoryCapacity is specified node memory capacity in bytes.
	MemoryCapacity int64 `json:"memoryCapacity"`

	// AllocatedPods in number of currently allocated pods on the node.
	AllocatedPods int `json:"allocatedPods"`

	// PodCapacity is maximum number of pods, that can be allocated on the node.
	PodCapacity int64 `json:"podCapacity"`

	// PodFraction is a fraction of pods, that can be allocated on given node.
	PodFraction float64 `json:"podFraction"`
}

NodeAllocatedResources describes node allocated resources.

type NodeCell

type NodeCell v1.Node

func (NodeCell) GetProperty

type NodeDetail

type NodeDetail struct {
	// Extends list item structure.
	Node `json:",inline"`

	// NodePhase is the current lifecycle phase of the node.
	Phase v1.NodePhase `json:"phase"`

	// PodCIDR represents the pod IP range assigned to the node.
	PodCIDR string `json:"podCIDR"`

	// ID of the node assigned by the cloud provider.
	ProviderID string `json:"providerID"`

	// Unschedulable controls node schedulability of new pods. By default node is schedulable.
	Unschedulable bool `json:"unschedulable"`

	// Set of ids/uuids to uniquely identify the node.
	NodeInfo v1.NodeSystemInfo `json:"nodeInfo"`

	//// Conditions is an array of current node conditions.
	Conditions []k8scommon.Condition `json:"conditions"`

	// Container images of the node.
	ContainerImages []string `json:"containerImages"`

	// PodListComponent contains information about pods belonging to this node.
	PodList v1.PodList `json:"podList"`

	// Events is list of events associated to the node.
	EventList v1.EventList `json:"eventList"`

	// Taints
	Taints []v1.Taint `json:"taints,omitempty"`

	// Addresses is a list of addresses reachable to the node. Queried from cloud provider, if available.
	Addresses []v1.NodeAddress `json:"addresses,omitempty"`

	Ready  v1.ConditionStatus `json:"ready"`
	NodeIP k8s.NodeIP         `json:"nodeIP"`
	UID    k8s.UID            `json:"uid"`
}

NodeDetail is a presentation layer view of Kubernetes Node resource. This means it is Node plus additional augmented data we can get from other sources.

func GetNodeDetail

func GetNodeDetail(client *kubernetes.Clientset, name string) (*NodeDetail, error)

type NodeList

type NodeList struct {
	ListMeta k8s.ListMeta `json:"listMeta"`
	Nodes    []Node       `json:"nodes"`
}

NodeList 包含集群中的节点列表.

func GetNodeList

func GetNodeList(client *kubernetes.Clientset, dsQuery *gin.Context) (*NodeList, error)

Jump to

Keyboard shortcuts

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