Documentation ¶
Index ¶
- Constants
- func Add(mgr manager.Manager) error
- func CanNodeBeDeployed(node *corev1.Node, ds *appsv1alpha1.DaemonSet) bool
- func GetPodRevision(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 NodeShouldRunDaemonPod(client client.Client, node *corev1.Node, ds *appsv1alpha1.DaemonSet) (wantToRun, shouldSchedule, shouldContinueRunning bool, err error)
- func NodeShouldUpdateBySelector(node *corev1.Node, ds *appsv1alpha1.DaemonSet) bool
- func Predicates(pod *corev1.Pod, nodeInfo *schedulernodeinfo.NodeInfo) (bool, []predicates.PredicateFailureReason, error)
- func ShouldIgnoreNodeUpdate(oldNode, curNode corev1.Node) bool
- func Simulate(kubeclient client.Client, newPod *corev1.Pod, node *corev1.Node, ...) ([]predicates.PredicateFailureReason, *schedulernodeinfo.NodeInfo, error)
- type ReconcileDaemonSet
Constants ¶
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 )
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 CanNodeBeDeployed ¶
func CanNodeBeDeployed(node *corev1.Node, ds *appsv1alpha1.DaemonSet) bool
CanNodeBeDployed checks if the node is ready for new daemon Pod.
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 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 ¶
func Predicates(pod *corev1.Pod, nodeInfo *schedulernodeinfo.NodeInfo) (bool, []predicates.PredicateFailureReason, error)
Predicates checks if a DaemonSet's pod can be scheduled on a node using GeneralPredicates and PodToleratesNodeTaints predicate
func ShouldIgnoreNodeUpdate ¶
func Simulate ¶
func Simulate(kubeclient client.Client, newPod *corev1.Pod, node *corev1.Node, ds *appsv1alpha1.DaemonSet) ([]predicates.PredicateFailureReason, *schedulernodeinfo.NodeInfo, error)
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.