client

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Clientset  *kubernetes.Clientset
	RestConfig *restclient.Config
)

Global variables

Functions

func GetActivePodsByNodeName

func GetActivePodsByNodeName(k8sclient k8sclient.Interface, nodeName string) (*v1.PodList, error)

GetActivePodsByNodeName gets pod with given Node name.

func GetAllPodsByNodeName

func GetAllPodsByNodeName(k8sclient k8sclient.Interface, nodeName string) (*v1.PodList, error)

GetAllPodsByNodeName gets pod with given Node name.

func GetNode

func GetNode(k8sclient k8sclient.Interface, nodeName string) (node *v1.Node, err error)

GetNode gets the latest node info

func GetNodeLabels

func GetNodeLabels(k8sclient k8sclient.Interface, nodeName string) (map[string]string, error)

func GetPodByName

func GetPodByName(k8sclient k8sclient.Interface, name, namespace string) (*v1.Pod, error)

GetPodByName gets pod with given name and namespace of the pod.

func IsCompletePod

func IsCompletePod(pod *v1.Pod) bool

IsCompletePod determines if the pod is complete

func IsFailedPod

func IsFailedPod(pod *v1.Pod) bool

IsFailedPod determines if the pod is failed

func IsReady

func IsReady(node v1.Node) (ready bool)

IsReady checks if the node is ready If the node is ready,it returns True.Otherwise,it returns False.

func IsSucceededPod

func IsSucceededPod(pod *v1.Pod) bool

IsSucceededPod determines if the pod is Succeeded

func KubeClient

func KubeClient() error

func KubeConfigClientSet

func KubeConfigClientSet(kubeConf string) (*kubernetes.Clientset, error)

func RefreshPod

func RefreshPod(k8sclient k8sclient.Interface, pod v1.Pod) (*v1.Pod, error)

RefreshPod takes an existing Pod object as an input, and re-reads it from the K8s API Returns the refreshed Pod descriptor in case of success, or an error

func SetPodAnnotation

func SetPodAnnotation(k8sclient k8sclient.Interface, pod *v1.Pod, key string, value string) error

SetPodAnnotation adds or modifies annotation for pod

Types

type Meta

type Meta struct {
	Annotations map[string]json.RawMessage `json:"annotations"`
}

type Update

type Update struct {
	Metadata Meta `json:"metadata"`
}

Jump to

Keyboard shortcuts

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