kubernetes

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNamespaceIfNotExists

func CreateNamespaceIfNotExists(client client.Client, namespace string) error

func GetAllKubernetesNodeIPAddresses

func GetAllKubernetesNodeIPAddresses(ctx context.Context, cli client.Client) (map[string]string, error)

GetAllKubernetesNodeIPAddresses returns a mapping of IPAddress -> node_name

func GetClient

func GetClient(restConfig *rest.Config) (client.Client, error)

GetClient returns a controller-runtime client with cass-operator API defined

func NewResourceLock

func NewResourceLock(namespace, lockName string, restConfig *rest.Config) (resourcelock.Interface, error)

func RunLeaderElection

func RunLeaderElection(ctx context.Context, wg *sync.WaitGroup, lock resourcelock.Interface)

func WaitForLock

func WaitForLock(ctx context.Context, namespace string, lockName string, client *NamespacedClient) error

Types

type NamespacedClient

type NamespacedClient struct {
	client.Client
	Config    *rest.Config
	Namespace string
}

NamespacedClient encapsulates namespacedClient with public namespace and restConfig

func GetClientInNamespace

func GetClientInNamespace(restConfig *rest.Config, namespace string) (NamespacedClient, error)

Jump to

Keyboard shortcuts

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