daemonset

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 69 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// BurstReplicas is a rate limiter for booting pods on a lot of pods.
	// The value of 250 is chosen b/c values that are too high can cause registry DoS issues.
	BurstReplicas = 250

	// ProgressiveCreatePod indicates daemon pods created in manage phase will be controlled by partition.
	// This annotation will be added to DaemonSet when it is created, and removed if partition is set to 0.
	ProgressiveCreatePod = "daemonset.kruise.io/progressive-create-pod"

	// BackoffGCInterval is the time that has to pass before next iteration of backoff GC is run
	BackoffGCInterval = 1 * time.Minute
)
View Source
const (
	// SelectingAllReason is added to an event when a DaemonSet selects all Pods.
	SelectingAllReason = "SelectingAll"
	// FailedPlacementReason is added to an event when a DaemonSet can't schedule a Pod to a specified node.
	FailedPlacementReason = "FailedPlacement"
	// FailedDaemonPodReason is added to an event when the status of a Pod of a DaemonSet is 'Failed'.
	FailedDaemonPodReason = "FailedDaemonPod"
)

Reasons for DaemonSet events

Variables

This section is empty.

Functions

func Add

func Add(mgr manager.Manager) error

Add creates a new DaemonSet 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 ContainsReadinessGate added in v1.0.0

func ContainsReadinessGate(pod *corev1.Pod) bool

ContainsReadinessGate returns true if pod has inplace update readiness gate.

func GetNodesNeedingPods added in v1.0.0

func GetNodesNeedingPods(newPodsNum, desire, partition int, progressive bool, nodesNeedingPods []string) []string

GetNodesNeedingPods finds which nodes should run daemon pod according to progressive flag and parititon.

func GetPodRevision

func GetPodRevision(controllerKey string, pod metav1.Object) string

GetPodRevision returns revision hash of this pod.

func GetTemplateGeneration

func GetTemplateGeneration(ds *appsv1alpha1.DaemonSet) (*int64, error)

func Match

func Match(ds *appsv1alpha1.DaemonSet, history *apps.ControllerRevision) (bool, error)

Match check if the given DaemonSet's template matches the template stored in the given history.

func NewPod

func NewPod(ds *appsv1alpha1.DaemonSet, nodeName string) *corev1.Pod

NewPod creates a new pod

func NodeShouldUpdateBySelector

func NodeShouldUpdateBySelector(node *corev1.Node, ds *appsv1alpha1.DaemonSet) bool

NodeShouldUpdateBySelector checks if the node is selected to upgrade for ds's gray update selector. This function does not check NodeShouldRunDaemonPod

func Predicates

func Predicates(pod *corev1.Pod, node *corev1.Node, taints []corev1.Taint) (fitsNodeName, fitsNodeAffinity, fitsTaints bool)

Predicates checks if a DaemonSet's pod can run on a node.

Types

type ReconcileDaemonSet

type ReconcileDaemonSet struct {
	runtimeclient.Client
	// contains filtered or unexported fields
}

ReconcileDaemonSet reconciles a DaemonSet object

func (*ReconcileDaemonSet) GetPodDaemonSets

func (dsc *ReconcileDaemonSet) GetPodDaemonSets(pod *corev1.Pod) ([]*appsv1alpha1.DaemonSet, error)

GetPodDaemonSets returns a list of DaemonSets that potentially match a pod. Only the one specified in the Pod's ControllerRef will actually manage it. Returns an error only if no matching DaemonSets are found.

func (*ReconcileDaemonSet) Reconcile

func (dsc *ReconcileDaemonSet) Reconcile(ctx context.Context, request reconcile.Request) (res reconcile.Result, retErr error)

Reconcile reads that state of the cluster for a DaemonSet object and makes changes based on the state read and what is in the DaemonSet.Spec

Jump to

Keyboard shortcuts

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