appstate

package
v1.108.10 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DaemonSetResourceKind    = "daemonset"
	DaemonSetPodVersionLabel = "controller-revision-hash"
	DaemonSetOwnerKind       = "DaemonSet"
)
View Source
const (
	StatefulSetResourceKind    = "statefulset"
	StatefulSetPodVersionLabel = "controller-revision-hash"
	StatefulSetOwnerKind       = "StatefulSet"
)
View Source
const (
	DeploymentResourceKind = "deployment"
)
View Source
const (
	IngressResourceKind = "ingress"
)
View Source
const (
	PersistentVolumeClaimResourceKind = "persistentvolumeclaim"
)
View Source
const (
	ServiceResourceKind = "service"
)

Variables

View Source
var (
	WaitForResourceFns = map[string]func(clientset kubernetes.Interface, namespace, name string) error{
		DaemonSetResourceKind:             WaitForDaemonSetToBeReady,
		DeploymentResourceKind:            WaitForDeploymentToBeReady,
		IngressResourceKind:               WaitForIngressToBeReady,
		PersistentVolumeClaimResourceKind: WaitForPersistentVolumeClaimToBeReady,
		ServiceResourceKind:               WaitForServiceToBeReady,
		StatefulSetResourceKind:           WaitForStatefulSetToBeReady,
	}

	WaitForResourceInterval = time.Second * 2
)

Functions

func CalculateDaemonSetState added in v1.100.0

func CalculateDaemonSetState(clientset kubernetes.Interface, targetNamespace string, r *appsv1.DaemonSet) types.State

The pods in a daemonset can be identified by the match label set in the daemonset and the "controller-revision-hash" can be used to determine if they are all the in the same daemonset version.

func CalculateDeploymentState added in v1.100.0

func CalculateDeploymentState(r *appsv1.Deployment) types.State

func CalculateIngressState added in v1.100.0

func CalculateIngressState(clientset kubernetes.Interface, r *networkingv1.Ingress) types.State

func CalculatePersistentVolumeClaimState added in v1.100.0

func CalculatePersistentVolumeClaimState(r *corev1.PersistentVolumeClaim) types.State

func CalculateServiceState added in v1.100.0

func CalculateServiceState(clientset kubernetes.Interface, r *corev1.Service) types.State

func CalculateStatefulSetState added in v1.100.0

func CalculateStatefulSetState(clientset kubernetes.Interface, targetNamespace string, r *appsv1.StatefulSet) types.State

func NewDeploymentEventHandler

func NewDeploymentEventHandler(informers []types.StatusInformer, resourceStateCh chan<- types.ResourceState) *deploymentEventHandler

func NewIngressEventHandler

func NewIngressEventHandler(clientset kubernetes.Interface, informers []types.StatusInformer, resourceStateCh chan<- types.ResourceState) *ingressEventHandler

func NewPersistentVolumeClaimEventHandler

func NewPersistentVolumeClaimEventHandler(informers []types.StatusInformer, resourceStateCh chan<- types.ResourceState) *persistentVolumeClaimEventHandler

func NewServiceEventHandler

func NewServiceEventHandler(clientset kubernetes.Interface, informers []types.StatusInformer, resourceStateCh chan<- types.ResourceState) *serviceEventHandler

func WaitForDaemonSetToBeReady added in v1.100.0

func WaitForDaemonSetToBeReady(clientset kubernetes.Interface, namespace, name string) error

func WaitForDeploymentToBeReady added in v1.100.0

func WaitForDeploymentToBeReady(clientset kubernetes.Interface, namespace, name string) error

func WaitForGenericResourceToBeReady added in v1.100.0

func WaitForGenericResourceToBeReady(dr dynamic.ResourceInterface, name string) (err error)

func WaitForIngressToBeReady added in v1.100.0

func WaitForIngressToBeReady(clientset kubernetes.Interface, namespace, name string) error

func WaitForPersistentVolumeClaimToBeReady added in v1.100.0

func WaitForPersistentVolumeClaimToBeReady(clientset kubernetes.Interface, namespace, name string) error

func WaitForProperty added in v1.100.0

func WaitForProperty(namespace, name string, gvk *schema.GroupVersionKind, path, desiredValue string) error

func WaitForResourceToBeReady added in v1.100.0

func WaitForResourceToBeReady(namespace, name string, gvk *schema.GroupVersionKind) error

func WaitForServiceToBeReady added in v1.100.0

func WaitForServiceToBeReady(clientset kubernetes.Interface, namespace, name string) error

func WaitForStatefulSetToBeReady added in v1.100.0

func WaitForStatefulSetToBeReady(clientset kubernetes.Interface, namespace, name string) error

Types

type AppMonitor

type AppMonitor struct {
	// contains filtered or unexported fields
}

func NewAppMonitor

func NewAppMonitor(clientset kubernetes.Interface, targetNamespace, appID string, sequence int64) *AppMonitor

func (*AppMonitor) AppStatusChan

func (m *AppMonitor) AppStatusChan() <-chan types.AppStatus

func (*AppMonitor) Apply

func (m *AppMonitor) Apply(informers []types.StatusInformer)

func (*AppMonitor) Shutdown

func (m *AppMonitor) Shutdown()

type EventHandler

type EventHandler interface {
	ObjectCreated(obj interface{})
	ObjectUpdated(obj interface{})
	ObjectDeleted(obj interface{})
}

type Monitor

type Monitor struct {
	// contains filtered or unexported fields
}

func NewMonitor

func NewMonitor(clientset kubernetes.Interface, targetNamespace string) *Monitor

func (*Monitor) AppStatusChan

func (m *Monitor) AppStatusChan() <-chan types.AppStatus

func (*Monitor) Apply

func (m *Monitor) Apply(appID string, sequence int64, informers []types.StatusInformer)

func (*Monitor) Shutdown

func (m *Monitor) Shutdown()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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