kubernetes

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKubernetesClient

func GetKubernetesClient() (kubernetes.Interface, error)

func GetKubernetesConfig

func GetKubernetesConfig() (*rest.Config, error)

func GetKubernetesLocalConfig

func GetKubernetesLocalConfig() (*rest.Config, error)

func GetNodeInstanceID

func GetNodeInstanceID(node *corev1.Node) string

func IsNodePassesReadinessGates

func IsNodePassesReadinessGates(node *corev1.Node, requiredReadinessGates []v1alpha1.NodeReadinessGate) bool

func IsNodeReady

func IsNodeReady(node *corev1.Node) bool

func SelectNodeByInstanceID

func SelectNodeByInstanceID(instanceID string, nodes []*corev1.Node) *corev1.Node

Types

type EventLevel

type EventLevel string

EventLevel defines the level of an event

type EventReason

type EventReason string

EventReason defines the reason of an event

const (
	// EventLevelNormal is the level of a normal event
	EventLevelNormal = "Normal"
	// EventLevelWarning is the level of a warning event
	EventLevelWarning = "Warning"
	// EventReasonRUStarted Rolling Upgrade Started
	EventReasonRUStarted EventReason = "RollingUpgradeStarted"
	// EventReasonRUInstanceStarted Rolling Upgrade for Instance has started
	EventReasonRUInstanceStarted EventReason = "RollingUpgradeInstanceStarted"
	// EventReasonRUInstanceFinished Rolling Upgrade for Instance has finished
	EventReasonRUInstanceFinished EventReason = "RollingUpgradeInstanceFinished"
	// EventReasonRUFinished Rolling Upgrade Finished
	EventReasonRUFinished EventReason = "RollingUpgradeFinished"
)

type EventWriter

type EventWriter struct {
	*KubernetesClientSet
	logr.Logger
}

func NewEventWriter

func NewEventWriter(k *KubernetesClientSet, logger logr.Logger) *EventWriter

func (*EventWriter) CreateEvent

func (w *EventWriter) CreateEvent(rollingUpgrade *v1alpha1.RollingUpgrade, reason EventReason, level string, msgFields map[string]string)

type KubernetesClientSet

type KubernetesClientSet struct {
	Kubernetes kubernetes.Interface
}

func (*KubernetesClientSet) DrainNode

func (k *KubernetesClientSet) DrainNode(node *corev1.Node, PostDrainDelaySeconds time.Duration, DrainTimeout int, client kubernetes.Interface) error

DrainNode cordons and drains a node.

func (*KubernetesClientSet) ListClusterNodes

func (k *KubernetesClientSet) ListClusterNodes() (*corev1.NodeList, error)

ListClusterNodes gets a list of all nodes in the cluster

Jump to

Keyboard shortcuts

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