Documentation ¶
Index ¶
- Constants
- type K8sClient
- func (kc *K8sClient) Debug() *K8sClient
- func (kc *K8sClient) GetConfig() *rest.Config
- func (kc *K8sClient) GetCurrentNamespace() string
- func (kc *K8sClient) GetKubeconfigPath() string
- func (kc *K8sClient) GetKubeconfigToken() (string, error)
- func (kc *K8sClient) IsConnected() bool
- func (kc *K8sClient) ListAllMatchingNamespaces(pattern string) ([]string, error)
- func (kc *K8sClient) ListAllNamespaces() ([]string, error)
- func (kc *K8sClient) NewOCPClientSet() (*ocpcs.Clientset, error)
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 (*K8sClient) GetCurrentNamespace ¶
Return the name of the current namespace ex:
namespace := kc.GetCurrentNamespace()
func (*K8sClient) GetKubeconfigPath ¶
Return the name of the kubeconfig path ex:
kubeconfigpath := kc.GetKubeconfigPath()
func (*K8sClient) GetKubeconfigToken ¶ added in v0.0.21
Get the token from the kubeconfig used
func (*K8sClient) IsConnected ¶
ConnectToCluster establishes a connection to the Kubernetes cluster.
func (*K8sClient) ListAllMatchingNamespaces ¶
Return the list of all the namespaces matching the pattern ex:
namespaces := kc.ListAllMatchingNamespaces("*dev*")
func (*K8sClient) ListAllNamespaces ¶
Return the list of all the namespaces ex:
namespaces := kc.ListAllNamespaces()
Click to show internal directories.
Click to hide internal directories.