workloadspread

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// CreatPodTimeout sets maximum time from the moment a pod is added to CreatePods in WorkloadSpread.Status by webhook
	// to the time when the pod is expected to be seen by controller. If the pod has not been found by controller
	// during that time it is assumed, which means it won't be created at all and corresponding record in map can be
	// removed from WorkloadSpread.Status. It is assumed that pod/ws apiserver to controller latency is relatively small (like 1-2sec)
	// so the below value should be more enough.
	CreatPodTimeout = 30 * time.Second

	// DeletePodTimeout is similar to the CreatePodTimeout and it's the time duration for deleting Pod.
	DeletePodTimeout = 15 * time.Second

	// FakeSubsetName is a fake subset name for such pods that do not match any subsets
	FakeSubsetName = "kruise.io/workloadspread-fake-subset-name"

	// IgnorePatchExistingPodsAnnotation ignore ws.Spec.Subsets[x].Patch for existing pods
	IgnorePatchExistingPodsAnnotation = "workloadspread.kruise.io/ignore-patch-existing-pods-metadata"
)
View Source
const (
	// RevisionAnnotation is the revision annotation of a deployment's replica sets which records its rollout sequence
	RevisionAnnotation = "deployment.kubernetes.io/revision"
)

Variables

This section is empty.

Functions

func Add

func Add(mgr manager.Manager) error

Add creates a new WorkloadSpread Controller and adds it to the Manager with default RBAC. The Manager will set fields on the Controller and Start it when the Manager is Started.

func GetWorkloadSpreadSubsetCondition

GetWorkloadSpreadSubsetCondition returns the condition with the provided type.

func NewWorkloadSpreadSubsetCondition

func NewWorkloadSpreadSubsetCondition(condType appsv1alpha1.WorkloadSpreadSubsetConditionType, status corev1.ConditionStatus, reason, message string) *appsv1alpha1.WorkloadSpreadSubsetCondition

NewWorkloadSpreadSubsetCondition creates a new WorkloadSpreadSubset condition.

func PodUnscheduledTimeout

func PodUnscheduledTimeout(ws *appsv1alpha1.WorkloadSpread, pod *corev1.Pod) bool

PodUnscheduledTimeout return true when Pod was scheduled failed and timeout.

Types

type EventAction

type EventAction string
const (
	CreateEventAction            EventAction = "Create"
	UpdateEventAction            EventAction = "Update"
	DeleteEventAction            EventAction = "Delete"
	DeploymentRevisionAnnotation             = "deployment.kubernetes.io/revision"
)

type ReconcileWorkloadSpread

type ReconcileWorkloadSpread struct {
	client.Client
	// contains filtered or unexported fields
}

ReconcileWorkloadSpread reconciles a WorkloadSpread object

func (*ReconcileWorkloadSpread) Reconcile

func (*ReconcileWorkloadSpread) UpdateWorkloadSpreadStatus

func (r *ReconcileWorkloadSpread) UpdateWorkloadSpreadStatus(ws *appsv1alpha1.WorkloadSpread,
	status *appsv1alpha1.WorkloadSpreadStatus) error

Jump to

Keyboard shortcuts

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