strategy

package
Version: v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package strategy contains the different ExtendedDaemonsetReplicaset pod's strategies: * canary * rolling-update * unknow

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeItem

type NodeItem struct {
	Node                     *corev1.Node
	ExtendedDaemonsetSetting *datadoghqv1alpha1.ExtendedDaemonsetSetting
}

NodeItem used to store all informations needs to create or delete a pod.

func NewNodeItem

func NewNodeItem(node *corev1.Node, edsNode *datadoghqv1alpha1.ExtendedDaemonsetSetting) *NodeItem

NewNodeItem used to create new NodeItem instance.

type NodeList

type NodeList struct {
	Items []*NodeItem
}

NodeList list of NodeItem.

type Parameters

type Parameters struct {
	MinPodUpdate int32
	MaxPodUpdate int32

	EDSName          string
	Strategy         *datadoghqv1alpha1.ExtendedDaemonSetSpecStrategy
	Replicaset       *datadoghqv1alpha1.ExtendedDaemonSetReplicaSet
	ReplicaSetStatus string

	NewStatus *datadoghqv1alpha1.ExtendedDaemonSetReplicaSetStatus

	CanaryNodes []string

	NodeByName      map[string]*NodeItem
	PodByNodeName   map[*NodeItem]*corev1.Pod
	PodToCleanUp    []*corev1.Pod
	UnscheduledPods []*corev1.Pod

	Logger logr.Logger
}

Parameters use to store all the parameter need to a strategy.

type ReplicaSetStatus

type ReplicaSetStatus string

ReplicaSetStatus repesent the status of a ReplicaSet.

const (
	// ReplicaSetStatusActive the ReplicaSet is currently active.
	ReplicaSetStatusActive ReplicaSetStatus = "active"
	// ReplicaSetStatusCanary the ReplicaSet is currently in canary mode.
	ReplicaSetStatusCanary ReplicaSetStatus = "canary"
	// ReplicaSetStatusCanaryFailed the ReplicaSet is currently in canary failed mode.
	ReplicaSetStatusCanaryFailed ReplicaSetStatus = "canary-failed"
	// ReplicaSetStatusUnknown the controller is not able to define the ReplicaSet status.
	ReplicaSetStatusUnknown ReplicaSetStatus = "unknown"
)

type Result

type Result struct {
	// PodsToCreate list of NodeItem for Pods creation.
	PodsToCreate []*NodeItem
	// PodsToDelete list of NodeItem for Pods deletion.
	PodsToDelete []*NodeItem

	UnscheduledNodesDueToResourcesConstraints []string

	// IsFrozen represents frozen status of the deployment.
	IsFrozen bool
	// IsPaused represents paused status of the deployment.
	IsPaused bool
	// PausedReason provides the reason for the paused deployment.
	PausedReason datadoghqv1alpha1.ExtendedDaemonSetStatusReason
	// IsUnpaused represents if the deployment was manually unpaused.
	IsUnpaused bool

	// IsFailed represents failed state of the deployment.
	IsFailed bool
	// FailedReason provides the reason for the failed deployment.
	FailedReason datadoghqv1alpha1.ExtendedDaemonSetStatusReason

	NewStatus *datadoghqv1alpha1.ExtendedDaemonSetReplicaSetStatus
	Result    reconcile.Result
}

Result information returns by a strategy.

func ManageCanaryDeployment

func ManageCanaryDeployment(client client.Client, daemonset *v1alpha1.ExtendedDaemonSet, params *Parameters) (*Result, error)

ManageCanaryDeployment used to manage ReplicaSet in Canary state.

func ManageDeployment

func ManageDeployment(client runtimeclient.Client, daemonset *datadoghqv1alpha1.ExtendedDaemonSet, params *Parameters, metaNow metav1.Time) (*Result, error)

ManageDeployment used to manage ReplicaSet in rollingupdate state.

func ManageUnknown

func ManageUnknown(client client.Client, params *Parameters) (*Result, error)

ManageUnknown use to manage ReplicaSet with unknown status.

Directories

Path Synopsis
Package limits contains function to calculate pod create/deletion limits.
Package limits contains function to calculate pod create/deletion limits.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL