Documentation
¶
Index ¶
- Constants
- type Handler
- func (in *Handler) DeepCopy() *Handler
- func (h *Handler) Get(name string) (*corev1.Node, error)
- func (h *Handler) GetAllInfo() ([]NodeInfo, error)
- func (h *Handler) GetByName(name string) (*corev1.Node, error)
- func (h *Handler) GetCIDR(name string) (string, error)
- func (h *Handler) GetCIDRs(name string) ([]string, error)
- func (h *Handler) GetHostname(name string) (hostname string, err error)
- func (h *Handler) GetIP(name string) (ip string, err error)
- func (h *Handler) GetMasterInfo() ([]NodeInfo, error)
- func (h *Handler) GetNonTerminatedPods(name string) (*corev1.PodList, error)
- func (h *Handler) GetPods(name string) (*corev1.PodList, error)
- func (h *Handler) GetRoles(name string) []string
- func (h *Handler) GetStatus(name string) *NodeStatus
- func (h *Handler) GetWorkerInfo() ([]NodeInfo, error)
- func (h *Handler) IsControlPlane(name string) bool
- func (h *Handler) IsMaster(name string) bool
- func (h *Handler) IsReady(name string) bool
- func (h *Handler) List(labels string) (*corev1.NodeList, error)
- func (h *Handler) ListAll() (*corev1.NodeList, error)
- func (h *Handler) ListByLabel(labels string) (*corev1.NodeList, error)
- func (h *Handler) RunInformer(addFunc func(obj interface{}), updateFunc func(oldObj, newObj interface{}), ...)
- func (h *Handler) SetLimit(limit int64)
- func (h *Handler) SetTimeout(timeout int64)
- func (h *Handler) WithDryRun() *Handler
- type NodeInfo
- type NodeStatus
Constants ¶
View Source
const ( // LabelNodeRolePrefix is a label prefix for node roles // It's copied over to here until it's merged in core: https://github.com/kubernetes/kubernetes/pull/39112 LabelNodeRolePrefix = "node-role.kubernetes.io/" // LabelNodeRole specifies the role of a node LabelNodeRole = "kubernetes.io/role" NodeRoleMaster = "master" NodeRoleControlPlane = "control-plane" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
Options *typed.HandlerOptions
sync.Mutex
// contains filtered or unexported fields
}
func (*Handler) GetAllInfo ¶
get all k8s node info
func (*Handler) GetHostname ¶
get the node hostname
func (*Handler) GetMasterInfo ¶
get all master node info
func (*Handler) GetNonTerminatedPods ¶
get not terminated pod in the node.
func (*Handler) GetRoles ¶
GetRoles returns the roles of a given node. The roles are determined by looking for:
node-role.kubernetes.io/<role>="" kubernetes.io/role="<role>"
func (*Handler) GetStatus ¶
func (h *Handler) GetStatus(name string) *NodeStatus
get the node status
func (*Handler) GetWorkerInfo ¶
get all worker node info
func (*Handler) IsControlPlane ¶
check if the node is control-plane
func (*Handler) ListByLabel ¶
ListByLabel list nodes by labels.
func (*Handler) RunInformer ¶
func (h *Handler) RunInformer( addFunc func(obj interface{}), updateFunc func(oldObj, newObj interface{}), deleteFunc func(obj interface{}), stopCh chan struct{})
RunInformer
func (*Handler) SetTimeout ¶
func (*Handler) WithDryRun ¶
type NodeInfo ¶
type NodeInfo struct {
Hostname string
IPAddress string
AllocatableCpu string
AllocatableMemory string
AllocatableStorage string
TotalCpu string
TotalMemory string
TotalStorage string
Architecture string
BootID string
ContainerRuntimeVersion string
KernelVersion string
KubeProxyVersion string
KubeletVersion string
MachineID string
OperatingSystem string
OSImage string
SystemUUID string
}
type NodeStatus ¶
Click to show internal directories.
Click to hide internal directories.