Documentation
¶
Overview ¶
Package tools implements tools to work with kubeernetes.
Index ¶
- func BuildConfig(kubeconfig, namespace string) (k *rest.Config, ns string, err error)
- func CSINodes(ctx context.Context, kclient *clientkubernetes.Clientset, csiDriverName string) ([]string, error)
- func CondonNodes(ctx context.Context, kclient *clientkubernetes.Clientset, nodes []string) ([]string, error)
- func PVCCreateOrUpdate(ctx context.Context, clientset *clientkubernetes.Clientset, ...) (*corev1.PersistentVolumeClaim, error)
- func PVCPodUsage(ctx context.Context, clientset *clientkubernetes.Clientset, ...) (pods []string, node string, err error)
- func PVCResources(ctx context.Context, clientset *clientkubernetes.Clientset, ...) (*corev1.PersistentVolumeClaim, *corev1.PersistentVolume, error)
- func PVWaitDelete(ctx context.Context, clientset *clientkubernetes.Clientset, pvName string) error
- func ProxmoxVMIDbyProviderID(_ context.Context, node *corev1.Node) (int, string, error)
- func UncondonNodes(ctx context.Context, kclient *clientkubernetes.Clientset, nodes []string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildConfig ¶
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
func PVCCreateOrUpdate( ctx context.Context, clientset *clientkubernetes.Clientset, pvc *corev1.PersistentVolumeClaim, ) (*corev1.PersistentVolumeClaim, error)
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 ¶
PVWaitDelete waits for the specified PersistentVolume to be deleted.
func ProxmoxVMIDbyProviderID ¶ added in v0.11.0
ProxmoxVMIDbyProviderID returns the Proxmox VM ID from the specified kubernetes node name.
func UncondonNodes ¶
UncondonNodes uncondones the specified nodes.
Types ¶
This section is empty.