k8sutils

package
v2.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateKubeClientSet

func CreateKubeClientSet(kubeConfig string) (*kubernetes.Clientset, error)

CreateKubeClientSet - Returns kubeClient set

func LeaderElection

func LeaderElection(clientSet *kubernetes.Clientset, lockName string, namespace string, runFunc func(ctx context.Context))

LeaderElection ...

Types

type K8sUtils added in v2.11.0

type K8sUtils struct {
	KubernetesClient *KubernetesClient
}

K8sUtils stores the configuration of the k8s client, k8s client and the informer

func Init added in v2.11.0

func Init(kubeConfig string) (*K8sUtils, error)

Init - Initializes the k8s client and creates the secret informer

func (*K8sUtils) GetNodeIPs added in v2.11.0

func (c *K8sUtils) GetNodeIPs(nodeID string) string

GetNodeIPs returns cluster IP of the node object

func (*K8sUtils) GetNodeLabels added in v2.11.0

func (c *K8sUtils) GetNodeLabels(nodeFullName string) (map[string]string, error)

GetNodeLabels returns back Node labels for the node name

type KubernetesClient added in v2.11.0

type KubernetesClient struct {
	ClientSet *kubernetes.Clientset
}

KubernetesClient - client connection

type UtilsInterface added in v2.11.0

type UtilsInterface interface {
	GetNodeLabels(string) (map[string]string, error)
	GetNodeIPs(string) string
}

UtilsInterface - interface which provides helper methods related to k8s

Jump to

Keyboard shortcuts

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