model

package
v0.0.0-...-c3d4854 Latest Latest
Warning

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

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

Documentation

Overview

save_pod_model.go

Index

Constants

View Source
const (
	ControlPlaneLabel = "node-role.kubernetes.io/control-plane"
	MasterNodeLabel   = "node-role.kubernetes.io/master"
)

Variables

This section is empty.

Functions

func GetNodeControlRoles

func GetNodeControlRoles(node *coreV1.Node) []string

func GetNodeHostName

func GetNodeHostName(node *coreV1.Node) string

func GetNodeIp

func GetNodeIp(node *coreV1.Node, addrType coreV1.NodeAddressType) string

func GetNodePressures

func GetNodePressures(node *coreV1.Node) []string

func GetNodeReadyStatus

func GetNodeReadyStatus(node *coreV1.Node) string

func IsNodeController

func IsNodeController(roles []string) bool

func SortNodeModels

func SortNodeModels(nodes []NodeModel)

func SortNodeModelsByField

func SortNodeModelsByField(nodes []NodeModel, sortBy int)

func SortPodModels

func SortPodModels(pods []PodModel)

func SortPodModelsByField

func SortPodModelsByField(pods []PodModel, sortBy int)

func SortSavedPodModels

func SortSavedPodModels(savedPods []SavedPodModel)

Types

type ClusterSummary

type ClusterSummary struct {
	Uptime                  metav1.Time // oldest running node
	NodesReady              int
	NodesCount              int
	Namespaces              int
	PodsRunning             int
	PodsAvailable           int
	Pressures               int
	ImagesCount             int
	VolumesAttached         int
	VolumesInUse            int
	JobsCount               int
	CronJobsCount           int
	StatefulSetsReady       int
	DeploymentsTotal        int
	DeploymentsReady        int
	DaemonSetsDesired       int
	DaemonSetsReady         int
	ReplicaSetsReady        int
	ReplicaSetsDesired      int
	AllocatableNodeCpuTotal *resource.Quantity
	AllocatableNodeMemTotal *resource.Quantity
	RequestedPodCpuTotal    *resource.Quantity
	RequestedPodMemTotal    *resource.Quantity
	UsageNodeCpuTotal       *resource.Quantity
	UsageNodeMemTotal       *resource.Quantity
	PVCount                 int
	PVsTotal                *resource.Quantity
	PVCCount                int
	PVCsTotal               *resource.Quantity

	KubeletReady    int
	KubeletCount    int
	ContainerdReady int
	ContainerdCount int
	SciniReady      int
	SciniCount      int
	EtcdReady       int
	EtcdCount       int
}

type ContainerStatusSummary

type ContainerStatusSummary struct {
	Ready       int
	Total       int
	Restarts    int
	Status      string
	SomeRunning bool
}

type NodeModel

type NodeModel struct {
	Name                 string
	Roles                []string
	Controller           bool
	Hostname             string
	Role                 string
	Status               string
	Pressures            []string
	CreationTime         metav1.Time
	TimeSinceStart       string
	InternalIP           string
	ExternalIP           string
	PodsCount            int
	ContainerImagesCount int
	VolumesInUse         int
	VolumesAttached      int

	KubeletVersion          string
	OS                      string
	OSImage                 string
	OSKernel                string
	Architecture            string
	ContainerRuntimeVersion string

	RequestedPodCpuQty *resource.Quantity
	RequestedPodMemQty *resource.Quantity

	AllocatableCpuQty     *resource.Quantity
	AllocatableMemQty     *resource.Quantity
	AllocatableStorageQty *resource.Quantity

	UsageCpuQty *resource.Quantity
	UsageMemQty *resource.Quantity

	Kubelet    bool
	Containerd bool
	Scini      bool
}

func NewNodeModel

func NewNodeModel(node *coreV1.Node, metrics *v1beta1.NodeMetrics) *NodeModel

type PodContainerSummary

type PodContainerSummary struct {
	RequestedMemQty *resource.Quantity
	RequestedCpuQty *resource.Quantity
	VolMounts       int
	Ports           int
}

func GetPodContainerSummary

func GetPodContainerSummary(pod *v1.Pod) PodContainerSummary

type PodModel

type PodModel struct {
	Namespace string
	Name      string
	Status    string
	Node      string
	IP        string
	TimeSince string

	PodRequestedCpuQty *resource.Quantity
	PodRequestedMemQty *resource.Quantity
	PodUsageCpuQty     *resource.Quantity
	PodUsageMemQty     *resource.Quantity

	NodeAllocatableCpuQty *resource.Quantity
	NodeAllocatableMemQty *resource.Quantity
	NodeUsageCpuQty       *resource.Quantity
	NodeUsageMemQty       *resource.Quantity

	ReadyContainers int
	TotalContainers int
	Restarts        int
	Volumes         int
	VolMounts       int

	CreationTimestamp metav1.Time
}

func NewPodModel

func NewPodModel(pod *v1.Pod, podMetrics *metricsV1beta1.PodMetrics, nodeMetrics *metricsV1beta1.NodeMetrics) *PodModel

type SavedPodModel

type SavedPodModel struct {
	Namespace string
	Name      string
	Status    string
	Node      string
	IP        string
	TimeSince string

	PodRequestedCpuQty *resource.Quantity
	PodRequestedMemQty *resource.Quantity
	PodUsageCpuQty     *resource.Quantity
	PodUsageMemQty     *resource.Quantity

	NodeAllocatableCpuQty *resource.Quantity
	NodeAllocatableMemQty *resource.Quantity
	NodeUsageCpuQty       *resource.Quantity
	NodeUsageMemQty       *resource.Quantity

	ReadyContainers int
	TotalContainers int
	Restarts        int
	Volumes         int
	VolMounts       int
}

func CopyPodModel

func CopyPodModel(original *PodModel) *SavedPodModel

복사 함수

Jump to

Keyboard shortcuts

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