kubernetes

package
v1.0.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MinimumVersion = "1.25"
)

Variables

This section is empty.

Functions

func CordonNode

func CordonNode(ctx context.Context, k8s *kubernetes.Clientset, node *corev1.Node, logger logr.Logger) error

func CreateNginxPodInNode

func CreateNginxPodInNode(ctx context.Context, k8s *kubernetes.Clientset, nodeName, namespace, region string, logger logr.Logger) error

func DeleteNode

func DeleteNode(ctx context.Context, k8s *kubernetes.Clientset, name string) error

func DeletePod

func DeletePod(ctx context.Context, k8s *kubernetes.Clientset, name, namespace string) error

func DrainNode

func DrainNode(ctx context.Context, k8s *kubernetes.Clientset, node *corev1.Node) error

func EnsureNodeWithIPIsDeleted

func EnsureNodeWithIPIsDeleted(ctx context.Context, k8s *kubernetes.Clientset, internalIP string) error

func ExecPodWithRetries added in v1.0.2

func ExecPodWithRetries(ctx context.Context, config *restclient.Config, k8s *kubernetes.Clientset, name, namespace string, cmd ...string) (stdout, stderr string, err error)

Retries up to 5 times to avoid connection errors

func GetDaemonSet added in v1.0.2

func GetDaemonSet(ctx context.Context, logger logr.Logger, k8s *kubernetes.Clientset, namespace, name string) (*appsv1.DaemonSet, error)

func GetNginxPodName

func GetNginxPodName(name string) string

func GetPodLogsWithRetries added in v1.0.2

func GetPodLogsWithRetries(ctx context.Context, k8s *kubernetes.Clientset, name, namespace string) (logs string, err error)

Retries up to 5 times to avoid connection errors

func IsPreviousVersionSupported

func IsPreviousVersionSupported(kubernetesVersion string) (bool, error)

func NewServiceAccount added in v1.0.3

func NewServiceAccount(ctx context.Context, logger logr.Logger, k8s *kubernetes.Clientset, namespace, name string) error

func PreviousVersion

func PreviousVersion(kubernetesVersion string) (string, error)

func UncordonNode

func UncordonNode(ctx context.Context, k8s *kubernetes.Clientset, node *corev1.Node) error

func WaitForHybridNodeToBeNotReady

func WaitForHybridNodeToBeNotReady(ctx context.Context, k8s *kubernetes.Clientset, nodeName string, logger logr.Logger) error

func WaitForHybridNodeToBeReady

func WaitForHybridNodeToBeReady(ctx context.Context, k8s *kubernetes.Clientset, nodeName string, logger logr.Logger) error

func WaitForNode

func WaitForNode(ctx context.Context, k8s *kubernetes.Clientset, internalIP string, logger logr.Logger) (*corev1.Node, error)

WaitForNode wait for the node to join the cluster and fetches the node info from an internal IP address of the node

func WaitForNodeToHaveVersion

func WaitForNodeToHaveVersion(ctx context.Context, k8s *kubernetes.Clientset, nodeName, targetVersion string, logger logr.Logger) (*corev1.Node, error)

Types

type VerifyNode

type VerifyNode struct {
	ClientConfig *rest.Config
	K8s          *clientgo.Clientset
	Logger       logr.Logger
	Region       string

	NodeIPAddress string
}

VerifyNode checks that a node is healthy, can run pods, extract logs and run commands on them.

func (VerifyNode) Run

func (v VerifyNode) Run(ctx context.Context) error

func (VerifyNode) WaitForNodeReady added in v1.0.3

func (v VerifyNode) WaitForNodeReady(ctx context.Context) (*corev1.Node, error)

Jump to

Keyboard shortcuts

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