client

package
v0.0.0-...-28d9058 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: UPL-1.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const APIServerBurst = 150
View Source
const APIServerQPS = 100
View Source
const EnvVarKubeConfig = "KUBECONFIG"

EnvVarKubeConfig Name of Environment Variable for KUBECONFIG

View Source
const EnvVarTestKubeConfig = "TEST_KUBECONFIG"

EnvVarTestKubeConfig Name of Environment Variable for test KUBECONFIG

View Source
const KubeApiServerPort = "6443"

Variables

View Source
var GetAPIExtV1ClientFunc = GetAPIExtV1Client

GetAPIExtV1ClientFunc is the function to return the ApiextensionsV1Interface

View Source
var GetAppsV1Func = GetAppsV1Client

GetAppsV1Func is the function the AppsV1Interface

View Source
var GetCoreV1Func = GetCoreV1Client

GetCoreV1Func is the function to return the CoreV1Interface

Functions

func BuildKubeConfig

func BuildKubeConfig(kubeconfig string) (*rest.Config, error)

func ClearFakeClient

func ClearFakeClient()

ClearFakeClient for unit tests

func GetAPIExtGoClient

func GetAPIExtGoClient(config *rest.Config) (apiextv1Client.Interface, error)

GetAPIExtGoClient returns an API Extensions go-client

func GetAPIExtV1Client

func GetAPIExtV1Client(config *rest.Config) (apiextv1.ApiextensionsV1Interface, error)

GetAPIExtV1Client returns the ApiextensionsV1Interface

func GetAppsV1Client

func GetAppsV1Client(config *rest.Config) (appsv1.AppsV1Interface, error)

GetAppsV1Client returns the AppsV1Interface

func GetCoreV1Client

func GetCoreV1Client(config *rest.Config) (corev1.CoreV1Interface, error)

GetCoreV1Client returns the CoreV1Interface

func GetDynamicClient

func GetDynamicClient(config *rest.Config) (dynamic.Interface, error)

GetDynamicClient returns a dynamic client

func GetGoClient

func GetGoClient(config *rest.Config) (kubernetes.Interface, error)

GetGoClient returns a go-client

func GetKubeClient

func GetKubeClient(kubeconfigPath string) (*rest.Config, kubernetes.Interface, error)

GetKubeClient - return a Kubernetes clientset for use with the go-client

func GetKubeConfig

func GetKubeConfig(kubeconfigPath string) (*rest.Config, error)

GetKubeConfig Returns kubeconfig from KUBECONFIG env var if set Else from default location ~/.kube/config

func GetKubeConfigGivenPath

func GetKubeConfigGivenPath(kubeconfigPath string) (*rest.Config, error)

GetKubeConfigGivenPath GetKubeConfig will get the kubeconfig from the given kubeconfigPath

func GetKubeConfigGivenPathAndContext

func GetKubeConfigGivenPathAndContext(kubeConfigPath string, kubeContext string) (*rest.Config, error)

GetKubeConfigGivenPathAndContext returns a rest.Config given a kubeConfig and kubeContext.

func GetKubeConfigLocation

func GetKubeConfigLocation(kubeconfigPath string) (string, bool, error)

GetKubeConfigLocation Helper function to obtain the default kubeConfig location

func GetKubeconfigPath

func GetKubeconfigPath(filename string) (string, error)

func GetKubernetesClientset

func GetKubernetesClientset(kubeconfigPath string) (*kubernetes.Clientset, error)

GetKubernetesClientset returns the Kubernetes clientset for the cluster set in the environment

func GetKubernetesClientsetWithConfig

func GetKubernetesClientsetWithConfig(config *rest.Config) (*kubernetes.Clientset, error)

GetKubernetesClientsetWithConfig returns the Kubernetes clientset for the given configuration

func GetNamespaceFromConfig

func GetNamespaceFromConfig(kubeConfigPath string) (string, error)

GetNamespaceFromConfig gets the namespace that is set in the current context of the kubeConfig file

func ResetCoreV1Client

func ResetCoreV1Client()

func ResetGetAPIExtV1ClientFunc

func ResetGetAPIExtV1ClientFunc()

ResetGetAPIExtV1ClientFunc for unit testing, to reset any overrides to GetAPIExtV1ClientFunc

func SetFakeClient

func SetFakeClient(client kubernetes.Interface)

SetFakeClient for unit tests

Types

type ClientConfigFunc

type ClientConfigFunc func() (*rest.Config, kubernetes.Interface, error)

type KubeInfo

type KubeInfo struct {
	KubeApiServerIP string
	KubeconfigPath  string
	RestConfig      *rest.Config
}

func CreateKubeInfo

func CreateKubeInfo(kubeConfigPath string) (*KubeInfo, error)

CreateKubeInfo returns a kubeInfo struct from a path to a kubeConfig

type TunnelInfo

type TunnelInfo struct {
	HostIP         string
	KubernetesIP   string
	KubernetesPort string
	SshUser        string
}

Jump to

Keyboard shortcuts

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