readiness

package
v1.9.5 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NegReadinessConditionStatus

func NegReadinessConditionStatus(pod *v1.Pod) (negCondition v1.PodCondition, exists bool)

NegReadinessConditionStatus return (cond, true) if neg condition exists, otherwise (_, false)

func NewPoller

func NewPoller(podLister cache.Indexer, lookup NegLookup, patcher podStatusPatcher, negCloud negtypes.NetworkEndpointGroupCloud) *poller

func SetNegReadinessConditionStatus

func SetNegReadinessConditionStatus(pod *v1.Pod, condition v1.PodCondition)

SetNegReadinessConditionStatus sets the status of the NEG readiness condition

Types

type NegLookup

type NegLookup interface {
	// ReadinessGateEnabledNegs returns a list of NEGs which has readiness gate enabled for the input pod's namespace and labels.
	ReadinessGateEnabledNegs(namespace string, labels map[string]string) []string
	// ReadinessGateEnabled returns true if the NEG requires readiness feedback
	ReadinessGateEnabled(syncerKey negtypes.NegSyncerKey) bool
}

NegLookup defines an interface for looking up pod membership.

type NoopReflector

type NoopReflector struct{}

func (*NoopReflector) CommitPods

func (*NoopReflector) Run

func (*NoopReflector) Run(<-chan struct{})

func (*NoopReflector) SyncPod

func (*NoopReflector) SyncPod(*v1.Pod)

type Reflector

type Reflector interface {
	// Run starts the reflector.
	// Closing stopCh will signal the reflector to stop running.
	Run(stopCh <-chan struct{})
	// SyncPod signals the reflector to evaluate pod and patch pod status if needed.
	SyncPod(pod *v1.Pod)
	// CommitPods signals the reflector that pods has been added to and NEG it is time to poll the NEG health status
	// syncerKey is the key to uniquely identify the NEG syncer
	// negName is the name of the network endpoint group (NEG) in the zone (e.g. k8s1-1234567-namespace-name-80-1234567)
	// zone is the corresponding zone of the NEG resource (e.g. us-central1-b)
	// endpointMap contains mapping from all network endpoints to pods which have been added into the NEG
	CommitPods(syncerKey negtypes.NegSyncerKey, negName string, zone string, endpointMap negtypes.EndpointPodMap)
}

Reflector defines the interaction between readiness reflector and other NEG controller components

func NewReadinessReflector

func NewReadinessReflector(cc *context.ControllerContext, lookup NegLookup) Reflector

Jump to

Keyboard shortcuts

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