daemonset

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: Apache-2.0 Imports: 60 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// StatusUpdateRetries limits the number of retries if sending a status update to API server fails.
	StatusUpdateRetries = 1

	IsIgnoreNotReady     = "daemonset.kruise.io/ignore-not-ready"
	IsIgnoreUnscheduable = "daemonset.kruise.io/ignore-unscheduable"

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

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

CanNodeBeDeployed checks if the node is ready for new daemon Pod.

func ContainsReadinessGate added in v1.0.0

func ContainsReadinessGate(pod *corev1.Pod) bool

ContainsReadinessGate returns true if pod has inplace update readiness gate.

func CreatePodProgressively added in v1.0.0

func CreatePodProgressively(ds *appsv1alpha1.DaemonSet) bool

CreatePodProgressively returns true if and only if the progressive annotation is set to true.

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 IsDaemonPodAvailable added in v1.0.0

func IsDaemonPodAvailable(pod *corev1.Pod, minReadySeconds int32) bool

IsPodUpdateReady returns true if a pod is ready after update progress.

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 NodeShouldRunDaemonPod

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

nodeShouldRunDaemonPod checks a set of preconditions against a (node,daemonset) and returns a summary. Returned booleans are:

  • shouldRun: Returns true when a daemonset should run on the node if a daemonset pod is not already running on that node.
  • shouldContinueRunning: Returns true when a daemonset should continue running on a node if a daemonset pod is already running on that node.

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.

func ShouldIgnoreNodeUpdate

func ShouldIgnoreNodeUpdate(oldNode, curNode corev1.Node) bool

func SplitByAvailablePods added in v1.0.0

func SplitByAvailablePods(minReadySeconds int32, pods []*corev1.Pod) ([]*corev1.Pod, []*corev1.Pod)

SplitByAvailablePods splits provided daemon set pods by availability

Types

type ReconcileDaemonSet

type ReconcileDaemonSet struct {
	// 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(_ context.Context, request reconcile.Request) (reconcile.Result, 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