kubernetes

package
v0.0.0-...-3bfe646 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 22 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeletePods

func DeletePods(client *kubernetes.Clientset, namespace string, selector map[string]string) error

DeletePods deletes all pods matching selector using provided client

func DeleteSelf

func DeleteSelf(client *kubernetes.Clientset, log logrus.FieldLogger) error

DeleteSelf deletes the pod this process is running as a part of.

func Drain

func Drain(ctx context.Context, client *kubernetes.Clientset, nodeName string) error

Drain safely drains the specified node and uses Eviction API if supported on the api server.

func GetNode

func GetNode(client *kubernetes.Clientset, server storage.Server) (*v1.Node, error)

GetNode returns Kubernetes node corresponding to the provided server

func Retry

func Retry(ctx context.Context, fn func() error) error

Retry retries the specified function fn using classify to determine whether to Retry a particular error. Returns the first permanent error

func RetryOnUpdateConflict

func RetryOnUpdateConflict(err error) error

RetryOnUpdateConflict retries on update conflict errors (and temporary failures).

func SetUnschedulable

func SetUnschedulable(ctx context.Context, client corev1.NodeInterface, nodeName string, unschedulable bool) error

SetUnschedulable marks the specified node as unschedulable depending on the value of the specified flag. Retries the operation internally on update conflicts.

func UpdateLabels

func UpdateLabels(ctx context.Context, client corev1.NodeInterface, nodeName string, labels map[string]string) error

UpdateLabels adds labels on the node specified with nodeName

func UpdateTaints

func UpdateTaints(ctx context.Context, client corev1.NodeInterface, nodeName string, taintsToAdd []v1.Taint, taintsToRemove []v1.Taint) error

UpdateTaints adds and/or removes taints specified with add/remove correspondingly on the specified node.

Types

type EndpointAddrs

type EndpointAddrs []v1.EndpointAddress

func (EndpointAddrs) String

func (r EndpointAddrs) String() string

type EndpointSubsets

type EndpointSubsets []v1.EndpointSubset

func (EndpointSubsets) String

func (r EndpointSubsets) String() string

type Endpoints

type Endpoints []v1.Endpoints

func (Endpoints) String

func (r Endpoints) String() string

Jump to

Keyboard shortcuts

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