k8s

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetContexts

func GetContexts(kubeconfigPath string) ([]string, error)

func GetNamespaces

func GetNamespaces(ctx context.Context, kubeconfigPath string, kubectx string) ([]string, error)

func GetPVCs

func GetPVCs(ctx context.Context, kubeconfigPath string, kubectx string, namespace string) ([]string, error)

func GetServiceAddress

func GetServiceAddress(
	ctx context.Context,
	cli kubernetes.Interface,
	namespace string,
	name string,
	lbTimeout time.Duration,
) (string, error)

func PortForward

func PortForward(req *PortForwardRequest) error

func WaitForJobCompletion

func WaitForJobCompletion(ctx context.Context, logger *log.Entry, cli kubernetes.Interface,
	namespace string, name string, progressBarRequested bool,
) error

func WaitForPod

func WaitForPod(ctx context.Context, cli kubernetes.Interface, namespace, labelSelector string) (*corev1.Pod, error)

Types

type ClusterClient

type ClusterClient struct {
	RestConfig       *rest.Config
	KubeClient       kubernetes.Interface
	RESTClientGetter genericclioptions.RESTClientGetter
	NsInContext      string
}

func GetClusterClient

func GetClusterClient(kubeconfigPath string, context string) (*ClusterClient, error)

type HelmRESTClientGetter

type HelmRESTClientGetter struct {
	// contains filtered or unexported fields
}

func NewRESTClientGetter

func NewRESTClientGetter(restConfig *rest.Config,
	clientConfig clientcmd.ClientConfig,
) *HelmRESTClientGetter

func (*HelmRESTClientGetter) ToDiscoveryClient

func (*HelmRESTClientGetter) ToRESTConfig

func (c *HelmRESTClientGetter) ToRESTConfig() (*rest.Config, error)

func (*HelmRESTClientGetter) ToRESTMapper

func (c *HelmRESTClientGetter) ToRESTMapper() (meta.RESTMapper, error)

func (*HelmRESTClientGetter) ToRawKubeConfigLoader

func (c *HelmRESTClientGetter) ToRawKubeConfigLoader() clientcmd.ClientConfig

type PortForwardRequest

type PortForwardRequest struct {
	// RestConfig is the kubernetes config
	RestConfig *rest.Config
	PodNs      string
	PodName    string
	LocalPort  int
	PodPort    int
	StopCh     <-chan struct{}
	ReadyCh    chan struct{}
	Logger     *log.Entry
}

Jump to

Keyboard shortcuts

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