Documentation ¶
Index ¶
- func BuildClientCmd(kubeconfig, context string) clientcmd.ClientConfig
- func BuildClientConfig(kubeconfig, context string) (*rest.Config, error)
- func NewClientset(client *Client) (*kubernetes.Clientset, error)
- func RunPortForwarder(fw *PortForward, readyFunc func(fw *PortForward) error) error
- type Client
- type ExecClient
- type PortForward
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 ¶
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 (*Client) BuildPortForwarder ¶
func (client *Client) BuildPortForwarder(podName string, ns string, localPort int, podPort int) (*PortForward, error)
BuildPortForwarder sets up port forwarding.
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