restarter

package
v0.0.0-...-975e3bd Latest Latest
Warning

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

Go to latest
Published: May 3, 2019 License: Apache-2.0, MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CrashLoopBackOff = "CrashLoopBackOff"
)

Variables

This section is empty.

Functions

func GetPodCondition

func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition)

GetPodCondition extracts the provided condition from the given status and returns that. Returns nil and -1 if the condition is not present, and the index of the located condition.

func GetPodConditionFromList

func GetPodConditionFromList(conditions []v1.PodCondition, conditionType v1.PodConditionType) (int, *v1.PodCondition)

GetPodConditionFromList extracts the provided condition from the given list of condition and returns the index of the condition and the condition. Returns -1 and nil if the condition is not present.

func GetPodReadyCondition

func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition

GetPodReadyCondition extracts the pod ready condition from the given status and returns that. Returns nil if the condition is not present.

func IsContainerInCrashLoopBackOff

func IsContainerInCrashLoopBackOff(containerState v1.ContainerState) bool

func IsPodAvailable

func IsPodAvailable(pod *v1.Pod, minReadySeconds int32, now metav1.Time) bool

IsPodAvailable returns true if a pod is available; false otherwise. Precondition for an available pod is that it must be ready. On top of that, there are two cases when a pod can be considered available: 1. minReadySeconds == 0, or 2. LastTransitionTime (is set) + minReadySeconds < current time

func IsPodDeleted

func IsPodDeleted(pod *v1.Pod) bool

IsPodReady returns true if a pod is ready; false otherwise.

func IsPodInCrashloopBackoff

func IsPodInCrashloopBackoff(status v1.PodStatus) bool

func IsPodReady

func IsPodReady(pod *v1.Pod) bool

IsPodReady returns true if a pod is ready; false otherwise.

func IsPodReadyConditionTrue

func IsPodReadyConditionTrue(status v1.PodStatus) bool

IsPodReadyConditionTrue returns true if a pod is ready; false otherwise.

func IsReadyEndpointPresentInSubsets

func IsReadyEndpointPresentInSubsets(subsets []v1.EndpointSubset) bool

func LoadServiceDependants

func LoadServiceDependants(file string) (*serviceDependants, error)

func ShouldDeletePod

func ShouldDeletePod(pod *v1.Pod) bool

Types

type Controller

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

Controller looks at ServiceDependants and reconciles the dependantPods once the service becomes available.

func NewController

func NewController(clientset *kubernetes.Clientset,
	sharedInformerFactory informers.SharedInformerFactory,
	serviceDependants *serviceDependants,
	watchDuration time.Duration,
	stopCh <-chan struct{}) *Controller

func (*Controller) Run

func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) error

Run will set up the event handlers for types we are interested in, as well as syncing informer caches and starting workers. It will block until stopCh is closed, at which point it will shutdown the workqueue and wait for workers to finish processing their current work items.

Jump to

Keyboard shortcuts

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