kubernetes

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: MIT Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildClientCmd

func BuildClientCmd(kubeconfig, context string) clientcmd.ClientConfig

BuildClientCmd builds a client cmd config from a kubeconfig filepath and context. It overrides the current context with the one provided (empty to use default).

This is a modified version of k8s.io/client-go/tools/clientcmd/BuildConfigFromFlags with the difference that it loads default configs if not running in-cluster.

func BuildClientConfig

func BuildClientConfig(kubeconfig, context string) (*rest.Config, error)

BuildClientConfig builds a client rest config from a kubeconfig filepath and context. It overrides the current context with the one provided (empty to use default).

This is a modified version of k8s.io/client-go/tools/clientcmd/BuildConfigFromFlags with the difference that it loads default configs if not running in-cluster.

func NewClientset

func NewClientset(client *Client) (*kubernetes.Clientset, error)

NewClientset creates a new Clientset for the given config.

func RunPortForwarder

func RunPortForwarder(fw *PortForward, readyFunc func(fw *PortForward) error) error

RunPortForwarder run the portforwarder

Types

type Client

type Client struct {
	Config *rest.Config
	*rest.RESTClient
}

Client is a helper wrapper around the Kube RESTClient for istioctl -> Pilot/Envoy/Mesh related things

func NewClient

func NewClient(kubeconfig, configContext string) (*Client, error)

NewClient is the constructor for the client wrapper

func (*Client) BuildPortForwarder

func (client *Client) BuildPortForwarder(podName string, ns string, localPort int, podPort int) (*PortForward, error)

BuildPortForwarder sets up port forwarding.

func (*Client) PodsForSelector

func (client *Client) PodsForSelector(namespace, labelSelector string) (*v1.PodList, error)

PodsForSelector get pods via label selector

type ExecClient

type ExecClient interface {
	PodsForSelector(namespace, labelSelector string) (*v1.PodList, error)
	BuildPortForwarder(podName string, ns string, localPort int, podPort int) (*PortForward, error)
}

ExecClient is an interface for remote execution

type PortForward

type PortForward struct {
	Forwarder    *portforward.PortForwarder
	LocalPort    int
	StopChannel  chan struct{}
	ReadyChannel <-chan struct{}
}

PortForward gathers port forwarding results

Jump to

Keyboard shortcuts

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