tools

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 11 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 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 ProxmoxVMID

func ProxmoxVMID(ctx context.Context, kclient clientkubernetes.Interface, nodeName string) (int, string, error)

ProxmoxVMID 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