k8sclient

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: GPL-3.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// GroupAPI is the group API scope use in this package
	GroupAPI = "sxlibs.k8s.startx.fr"
	// GroupName is the group name use in this package
	GroupName = "k8sclient"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type K8sClient

type K8sClient struct {
	*kubernetes.Clientset
	// contains filtered or unexported fields
}

K8sClient represents a wrapper around the Kubernetes clientset.

func NewK8sClient

func NewK8sClient(kubeconfigpath string) *K8sClient

Initialize a K8sClient object ex:

k8sclient := kc.NewK8sClient()

func (*K8sClient) Debug

func (kc *K8sClient) Debug() *K8sClient

Return a display of the current object ex:

kc.Debug()

func (*K8sClient) GetCurrentNamespace

func (kc *K8sClient) GetCurrentNamespace() string

Return the name of the current namespace ex:

namespace := kc.GetCurrentNamespace()

func (*K8sClient) GetKubeconfigPath

func (kc *K8sClient) GetKubeconfigPath() string

Return the name of the kubeconfig path ex:

kubeconfigpath := kc.GetKubeconfigPath()

func (*K8sClient) IsConnected

func (kc *K8sClient) IsConnected() bool

ConnectToCluster establishes a connection to the Kubernetes cluster.

func (*K8sClient) ListAllMatchingNamespaces

func (kc *K8sClient) ListAllMatchingNamespaces(pattern string) ([]string, error)

Return the list of all the namespaces matching the pattern ex:

namespaces := kc.ListAllMatchingNamespaces("*dev*")

func (*K8sClient) ListAllNamespaces

func (kc *K8sClient) ListAllNamespaces() ([]string, error)

Return the list of all the namespaces ex:

namespaces := kc.ListAllNamespaces()

Jump to

Keyboard shortcuts

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