tools

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package tools implements tools to work with kubeernetes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildConfig

func BuildConfig(kubeconfig, namespace string) (k *rest.Config, ns string, err error)

BuildConfig returns a kubernetes client configuration and namespace.

func CSINodes

func CSINodes(ctx context.Context, kclient *clientkubernetes.Clientset, csiDriverName string) ([]string, error)

CSINodes returns a list of nodes that have the specified CSI driver name.

func CondonNodes

func CondonNodes(ctx context.Context, kclient *clientkubernetes.Clientset, nodes []string) ([]string, error)

CondonNodes condones the specified nodes.

func PVCCreateOrUpdate added in v0.7.0

PVCCreateOrUpdate creates or updates the specified PersistentVolumeClaim resource.

func PVCPodUsage

func PVCPodUsage(ctx context.Context, clientset *clientkubernetes.Clientset, namespace, pvcName string) (pods []string, node string, err error)

PVCPodUsage returns the list of pods and the node that are using the specified PersistentVolumeClaim.

func PVCResources

func PVCResources(ctx context.Context, clientset *clientkubernetes.Clientset, namespace, pvcName string) (*corev1.PersistentVolumeClaim, *corev1.PersistentVolume, error)

PVCResources returns the PersistentVolumeClaim and PersistentVolume resources.

func PVWaitDelete

func PVWaitDelete(ctx context.Context, clientset *clientkubernetes.Clientset, pvName string) error

PVWaitDelete waits for the specified PersistentVolume to be deleted.

func ProxmoxVMIDbyProviderID added in v0.11.0

func ProxmoxVMIDbyProviderID(_ context.Context, node *corev1.Node) (int, string, error)

ProxmoxVMIDbyProviderID returns the Proxmox VM ID from the specified kubernetes node name.

func UncondonNodes

func UncondonNodes(ctx context.Context, kclient *clientkubernetes.Clientset, nodes []string) error

UncondonNodes uncondones the specified nodes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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