kubernetes

package
v0.0.0-...-b40e610 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(kubeconfig *string) (*kubernetes.Clientset, error)

Connects to kubernetes cluster

func GetHostList

func GetHostList(conn *kubernetes.Clientset, namespace *string, selector *string, usePods *bool) *[]Node

Returns Final list of nodes corresponding user query

func GetNodeInternalIP

func GetNodeInternalIP(node *v1.Node) string

Returns node InternalIP. returns as soon as first instance of InternalIP is found

func GetPodsNodes

func GetPodsNodes(clientset *kubernetes.Clientset, pods *v1.PodList) *[]*v1.Node

Returns slice of unique nodes on which Pods are running

func IfHostReady

func IfHostReady(node *v1.Node) bool

Checks whether node is Ready, a.k.a healthy, or not

func QueryNodes

func QueryNodes(clientset *kubernetes.Clientset, labels *string) *v1.NodeList

Query for Nodes using given LabelSelector if any

func QueryPods

func QueryPods(clientset *kubernetes.Clientset, namespace *string, labels *string) *v1.PodList

Query Pods in given Namespace using provided LabelSelector if any

Types

type Node

type Node struct {
	Name        string
	InternalIP  string
	Annotations map[string]string
	Labels      map[string]string
}

Jump to

Keyboard shortcuts

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