kubernetes

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// https://github.com/kubernetes/autoscaler/blob/5bf33b23f2bcf5f9c8ccaf99d445e25366ee7f40/cluster-autoscaler/utils/taints/taints.go#L39-L42
	ToBeDeletedTaint       = "ToBeDeletedByClusterAutoscaler"
	DeletionCandidateTaint = "DeletionCandidateOfClusterAutoscaler"
)

Variables

This section is empty.

Functions

func DrainNode

func DrainNode(ctx context.Context, clientset kubernetes.Interface, node *corev1.Node) error

DrainNode uses the default drain implementation to drain the Node: https://github.com/kubernetes/kubectl/blob/3ec401449e5821ad954942c7ecec9d2c90ecaaa1/pkg/drain/default.go

func NewClient added in v0.4.0

func NewClient() (client.WithWatch, *rest.Config, error)

func NewListerWatcher added in v0.2.0

func NewListerWatcher(ctx context.Context, kubeClient client.WithWatch, objectList client.ObjectList, opts ...client.ListOption) cache.ListerWatcher

func NewWatcher added in v0.2.0

func NewWatcher(ctx context.Context, kubeClient client.WithWatch, objectList client.ObjectList, opts ...client.ListOption) cache.Watcher

func ParseWatchEventObject added in v0.2.0

func ParseWatchEventObject[T runtime.Object](event watch.Event) (T, error)

ParseWatchEventObject determines if the specified watch event is an error and if so returns an error and otherwise asserts and returns an object of the expected type

func PortForward added in v0.4.0

func PortForward(ctx context.Context, restConfig *rest.Config, podNamespace, podName string, port int) (uint16, func() error, error)

PortForward port forwards to the specified Pod. The forwarded port is a random available local port which is returned as well as a function to stop the port forward when finished

func SelectorMatchesLabels added in v0.2.0

func SelectorMatchesLabels(labelSelector *metav1.LabelSelector, resourceLabels map[string]string) (bool, error)

func WaitForAnyReadyPod added in v0.4.0

func WaitForAnyReadyPod(ctx context.Context, kubeClient client.WithWatch, opts ...client.ListOption) (*corev1.Pod, error)

func WaitForNodeToBeDeleted

func WaitForNodeToBeDeleted(ctx context.Context, clientset kubernetes.Interface, nodeName string) error

func WaitUntilDeploymentAvailable added in v0.2.0

func WaitUntilDeploymentAvailable(ctx context.Context, kubeClient client.WithWatch, deploymentNamespace, deploymentName string) error

func WaitUntilDeploymentUnavailable added in v0.3.0

func WaitUntilDeploymentUnavailable(ctx context.Context, kubeClient client.WithWatch, deploymentNamespace, deploymentName string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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