inplaceupdate

package
v0.0.0-...-7f68784 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckInPlaceUpdateCompleted

func CheckInPlaceUpdateCompleted(pod *v1.Pod) error

CheckInPlaceUpdateCompleted checks whether imageID in pod status has been changed since in-place update. If the imageID in containerStatuses has not been changed, we assume that kubelet has not updated containers in Pod.

func GetCondition

func GetCondition(pod *v1.Pod) *v1.PodCondition

GetCondition returns the InPlaceUpdateReady condition in Pod.

func GetTemplateFromRevision

func GetTemplateFromRevision(revision *apps.ControllerRevision) (*v1.PodTemplateSpec, error)

GetTemplateFromRevision returns the pod template parsed from ControllerRevision.

func InjectReadinessGate

func InjectReadinessGate(pod *v1.Pod)

InjectReadinessGate injects InPlaceUpdateReady into pod.spec.readinessGates

Types

type CustomizeCheckUpdateCompletedFunc

type CustomizeCheckUpdateCompletedFunc func(pod *v1.Pod) error

type CustomizeSpecCalculateFunc

type CustomizeSpecCalculateFunc func(oldRevision, newRevision *apps.ControllerRevision) *UpdateSpec

type CustomizeSpecPatchFunc

type CustomizeSpecPatchFunc func(pod *v1.Pod, spec *UpdateSpec) (*v1.Pod, error)

type Interface

type Interface interface {
	Refresh(pod *v1.Pod, opts *UpdateOptions) RefreshResult
	Update(pod *v1.Pod, oldRevision, newRevision *apps.ControllerRevision, opts *UpdateOptions) UpdateResult
}

Interface for managing pods in-place update.

func New

func New(c client.Client, revisionKey string) Interface

func NewForInformer

func NewForInformer(informer coreinformers.PodInformer, revisionKey string) Interface

func NewForTest

func NewForTest(c client.Client, revisionKey string, now func() metav1.Time) Interface

func NewForTypedClient

func NewForTypedClient(c clientset.Interface, revisionKey string) Interface

type RefreshResult

type RefreshResult struct {
	RefreshErr    error
	DelayDuration time.Duration
}

type UpdateOptions

type UpdateOptions struct {
	GracePeriodSeconds int32

	CustomizeSpecCalculate        CustomizeSpecCalculateFunc
	CustomizeSpecPatch            CustomizeSpecPatchFunc
	CustomizeCheckUpdateCompleted CustomizeCheckUpdateCompletedFunc
}

type UpdateResult

type UpdateResult struct {
	InPlaceUpdate bool
	UpdateErr     error
	DelayDuration time.Duration
}

type UpdateSpec

type UpdateSpec struct {
	Revision    string            `json:"revision"`
	Annotations map[string]string `json:"annotations,omitempty"`

	ContainerImages map[string]string `json:"containerImages,omitempty"`
	MetaDataPatch   []byte            `json:"metaDataPatch,omitempty"`
	GraceSeconds    int32             `json:"graceSeconds,omitempty"`

	OldTemplate *v1.PodTemplateSpec `json:"oldTemplate,omitempty"`
	NewTemplate *v1.PodTemplateSpec `json:"newTemplate,omitempty"`
}

UpdateSpec records the images of containers which need to in-place update.

Jump to

Keyboard shortcuts

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