Documentation ¶
Index ¶
- Constants
- func Add(mgr manager.Manager) error
- func ContainsReadinessGate(pod *corev1.Pod) bool
- func GetNodesNeedingPods(newPodsNum, desire, partition int, progressive bool, nodesNeedingPods []string) []string
- func GetPodRevision(controllerKey string, pod metav1.Object) string
- func GetTemplateGeneration(ds *appsv1alpha1.DaemonSet) (*int64, error)
- func Match(ds *appsv1alpha1.DaemonSet, history *apps.ControllerRevision) (bool, error)
- func NewPod(ds *appsv1alpha1.DaemonSet, nodeName string) *corev1.Pod
- func NodeShouldUpdateBySelector(node *corev1.Node, ds *appsv1alpha1.DaemonSet) bool
- func Predicates(pod *corev1.Pod, node *corev1.Node, taints []corev1.Taint) (fitsNodeName, fitsNodeAffinity, fitsTaints bool)
- type ReconcileDaemonSet
Constants ¶
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 )
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 ¶
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
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 ¶
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
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