statefulset

package
Version: v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2020 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// AnnotationCanaryRolloutEnabled if set to "true" canary behaviour is desired
	AnnotationCanaryRolloutEnabled = fmt.Sprintf("%s/canary-rollout-enabled", apis.GroupName)
	// AnnotationCanaryRollout is the state of the canary rollout of the stateful set
	AnnotationCanaryRollout = fmt.Sprintf("%s/canary-rollout", apis.GroupName)
	// AnnotationCanaryWatchTime is the max time for the canary update
	AnnotationCanaryWatchTime = fmt.Sprintf("%s/canary-watch-time-ms", apis.GroupName)
	// AnnotationUpdateWatchTime is the max time for the complete update
	AnnotationUpdateWatchTime = fmt.Sprintf("%s/update-watch-time-ms", apis.GroupName)
	// AnnotationUpdateStartTime is the timestamp when the update started
	AnnotationUpdateStartTime = fmt.Sprintf("%s/update-start-time", apis.GroupName)
)

Functions

func AddStatefulSetRollout

func AddStatefulSetRollout(ctx context.Context, config *config.Config, mgr manager.Manager) error

AddStatefulSetRollout creates a new statefulset rollout controller and adds it to the manager. The purpose of this controller is to remove the partition of the statefulset if the canary succeeds.

func CheckUpdate

func CheckUpdate(e event.UpdateEvent) bool

CheckUpdate checks if update event should be processed

func CleanupNonReadyPod

func CleanupNonReadyPod(ctx context.Context, client crc.Client, statefulSet *appsv1.StatefulSet, index int32) error

CleanupNonReadyPod deletes all pods, that are not ready

func ComputeAnnotations

func ComputeAnnotations(ig *manifest.InstanceGroup) (map[string]string, error)

ComputeAnnotations computes annotations from the instance group

func ConfigureStatefulSetForInitialRollout

func ConfigureStatefulSetForInitialRollout(statefulSet *appsv1.StatefulSet)

ConfigureStatefulSetForInitialRollout initially configures a stateful set for canarying and rollout

func ConfigureStatefulSetForRollout

func ConfigureStatefulSetForRollout(statefulSet *appsv1.StatefulSet)

ConfigureStatefulSetForRollout configures a stateful set for canarying and rollout

func ExtractWatchTime

func ExtractWatchTime(rawWatchTime string, field string) (string, error)

ExtractWatchTime computes the watch time from a range or an absolute value

func FilterLabels

func FilterLabels(labels map[string]string) map[string]string

FilterLabels filters out labels, that are not suitable for StatefulSet updates

func NewMutator

func NewMutator(log *zap.SugaredLogger, config *config.Config) admission.Handler

NewMutator returns a new reconcile.Reconciler

func NewStatefulSetRolloutMutator

func NewStatefulSetRolloutMutator(log *zap.SugaredLogger, config *config.Config) *wh.OperatorWebhook

NewStatefulSetRolloutMutator creates a statefulset mutator for setting the partion

func NewStatefulSetRolloutReconciler

func NewStatefulSetRolloutReconciler(ctx context.Context, config *config.Config, mgr manager.Manager) reconcile.Reconciler

NewStatefulSetRolloutReconciler returns a new reconcile.Reconciler

Types

type Mutator

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

Mutator changes statefulset definitions

func (*Mutator) Handle

Handle set the partion for StatefulSets

func (*Mutator) InjectDecoder

func (m *Mutator) InjectDecoder(d *admission.Decoder) error

InjectDecoder injects the decoder.

type ReconcileStatefulSetRollout

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

ReconcileStatefulSetRollout reconciles an QuarksStatefulSet object when references changes

func (*ReconcileStatefulSetRollout) Reconcile

Reconcile cleans up old versions and volumeManagement statefulSet of the QuarksStatefulSet

Jump to

Keyboard shortcuts

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