kubelib

package
v0.0.0-...-fdc0f55 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateKubeClientFromKubeConfig

func CreateKubeClientFromKubeConfig(kubeConfigPath string) (kubernetes.Interface, error)

CreateKubeClientFromKubeConfig creates a kubernetes client from the kubeconfig file at the given path.

func FollowLogs

func FollowLogs(
	ctx context.Context,
	client kubernetes.Interface,
	params *FollowLogsParams,
) error

FollowLogs follows the logs of the pods that match the selector.

Types

type FollowLogsParams

type FollowLogsParams struct {
	// Namespace is the namespace of the pods.
	Namespace string
	// Selector is the selector of the pods.
	Selector labels.Selector
	// Container is the container name of the pods.
	Container string
	// MaxConcurrency is the maximum number of concurrent log streams to follow.
	MaxConcurrency int
	// AddPrefix specifies whether to add the prefix of the pod name to the logs.
	AddPrefix bool

	// Output is the writer to write the logs to.
	Output io.Writer
}

FollowLogsParams is the parameters for following logs.

type KubeClientFactory

type KubeClientFactory func(kubeConfigPath string) (kubernetes.Interface, error)

KubeClientFactory is a function that creates a kubernetes client from the kubeconfig file at the given path.

Jump to

Keyboard shortcuts

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