daemonset

package
v0.0.0-...-7f68784 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2020 License: Apache-2.0 Imports: 54 Imported by: 0

Documentation

Index

Constants

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

	IsFirstDeployedFlag = "daemonset.kruise.io/is-first-deployed"

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

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

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

func GetPodRevision

func GetPodRevision(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 NodeShouldRunDaemonPod

func NodeShouldRunDaemonPod(client client.Client, node *corev1.Node, ds *appsv1alpha1.DaemonSet) (wantToRun, shouldSchedule, shouldContinueRunning bool, err error)

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

  • wantToRun: Returns true when a user would expect a pod to run on this node and ignores conditions such as DiskPressure or insufficient resource that would cause a daemonset pod not to schedule. This is primarily used to populate daemonset status.
  • shouldSchedule: Returns true when a daemonset should be scheduled to a 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

Predicates checks if a DaemonSet's pod can be scheduled on a node using GeneralPredicates and PodToleratesNodeTaints predicate

func ShouldIgnoreNodeUpdate

func ShouldIgnoreNodeUpdate(oldNode, curNode corev1.Node) bool

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(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