strategy

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

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"
	// 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

	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 client.Client, params *Parameters) (*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

Jump to

Keyboard shortcuts

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