kube

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLocalAddress      = "localhost"
	DefaultPodRunningTimeout = 30 * time.Second
	KmeshNamespace           = "kmesh-system"
)

Variables

This section is empty.

Functions

func CreateKubeClient added in v1.0.0

func CreateKubeClient(kubeConfig string, applyFuncs ...func(c *rest.Config)) (kubernetes.Interface, error)

CreateKubeClient creates a kube client with the given kubeconfig file, if no kubeconfig specified, in cluster kubeconfig will be used. applyFuncs is optional, which can be used to tune client rest.Config

func GetKmeshNodeInfoClient added in v1.0.0

func GetKmeshNodeInfoClient() (nodeinfo.Interface, error)

Types

type CLIClient added in v1.0.0

type CLIClient interface {
	Client

	// PodsForSelector finds pods matching selector.
	PodsForSelector(ctx context.Context, namespace string, labelSelectors ...string) (*v1.PodList, error)

	// NewPortForwarder creates a new PortForwarder configured for the given pod. If localPort=0, a port will be
	// dynamically selected. If localAddress is empty, "localhost" is used.
	NewPortForwarder(podName string, ns string, localAddress string, localPort int, podPort int) (PortForwarder, error)
}

CLIClient extends the Client interface with additional functionality for CLI operations.

func NewCLIClient added in v1.0.0

func NewCLIClient(opts ...ClientOption) (CLIClient, error)

type Client added in v1.0.0

type Client interface {
	// Kube returns the core kube client
	Kube() kubernetes.Interface

	// GatewayAPI returns the gateway-api kube client.
	GatewayAPI() gatewayapiclient.Interface
}

Client defines the interface for accessing Kubernetes clients and resources.

type ClientOption added in v1.0.0

type ClientOption func(CLIClient) CLIClient

type PortForwarder added in v1.0.0

type PortForwarder interface {
	// Start runs this forwarder.
	Start() error

	// Address returns the local forwarded address. Only valid while the forwarder is running.
	Address() string

	// Close this forwarder and release an resources.
	Close()
}

PortForwarder manages the forwarding of a single port.

Directories

Path Synopsis
apis
nodeinfo
clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
clientset/versioned/typed/kmeshnodeinfo/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
clientset/versioned/typed/kmeshnodeinfo/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.

Jump to

Keyboard shortcuts

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