kubeclient

package
v0.0.0-...-e5c8c29 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteContext

func DeleteContext(kubeConfigPath string, contextName string) error

TODO: Should we rename this to CleanupContext? new package / file for kubeconfig stuff? DeleteContext deletes the context from the kubeconfig file and also deletes the corresponding cluster and user from the kubeconfig file

func UseKubeConfigContext

func UseKubeConfigContext(workloadClusterKubeContext string) error

Types

type KubeClient

type KubeClient struct {
	kubernetes.Interface
}

With the below we can have sugar coat methods on KubeClient and also to the full power of kube client golang library as that field is exposed

func GetKubeClient

func GetKubeClient(kubeConfigPath string, context string) (*KubeClient, error)

GetKubeClient creates a Kubernetes client for a given kubeconfig path and kubeconfig context in the kubeconfig. When context is empty, the current context mentioned in the kubeconfig is used by the kube client

func (*KubeClient) GetAllNodes

func (kubeclient *KubeClient) GetAllNodes() (*v1.NodeList, error)

TODO: Should we return []Node instead of *v1.PodList ? Something to think about

func (*KubeClient) GetAllPodsFromAllNamespaces

func (kubeclient *KubeClient) GetAllPodsFromAllNamespaces() (*v1.PodList, error)

TODO: Should we return []Pod instead of *v1.PodList ? Something to think about TODO: Maybe change the name of the below receiver? It's the same as the package name

Jump to

Keyboard shortcuts

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