Documentation
¶
Index ¶
- Constants
- func AppendTaint(r client.Client, nodeName string, taint corev1.Taint) (bool, error)
- func CreateOutOfServiceTaint() corev1.Taint
- func CreateRemediationTaint() corev1.Taint
- func GetDeploymentNamespace() (string, error)
- func GetFenceAgentsRemediationPod(r client.Reader) (*corev1.Pod, error)
- func GetNode(nodeRole, nodeName string) *corev1.Node
- func GetNodeWithName(r client.Reader, nodeName string) (*corev1.Node, error)
- func RemoveTaint(r client.Client, nodeName string, taint corev1.Taint) error
- func TaintExists(taints []corev1.Taint, taintToFind *corev1.Taint) bool
- func UpdateConditions(reason ConditionsChangeReason, far *v1alpha1.FenceAgentsRemediation, ...)
- type ConditionsChangeReason
Constants ¶
const ( // FenceAgentActionSucceededType is the condition type used to signal whether the Fence Agent action was succeeded successfully or not FenceAgentActionSucceededType = "FenceAgentActionSucceeded" // condition messages RemediationFinishedNodeNotFoundConditionMessage = "FAR CR name doesn't match a node name" RemediationInterruptedByNHCConditionMessage = "Node Healthcheck timeout annotation has been set. Remediation has stopped" RemediationStartedConditionMessage = "FAR CR was found, its name matches one of the cluster nodes, and a finalizer was set to the CR" FenceAgentSucceededConditionMessage = "FAR taint was added and the fence agent command has been created and executed successfully" FenceAgentFailedConditionMessage = "Fence agent command has failed" FenceAgentTimedOutConditionMessage = "Time out occurred while executing the Fence agent command" RemediationFinishedSuccessfullyConditionMessage = "" /* 131-byte string literal not displayed */ )
const ( // common events reason and message EventReasonRemediationStarted = "RemediationStarted" EventMessageRemediationStarted = "Remediation started" // events reasons EventReasonCrNodeNotFound = "NodeNotFound" EventReasonRemediationStoppedByNHC = "RemediationStoppedByNHC" EventReasonAddFinalizer = "AddFinalizer" EventReasonRemoveRemediationTaint = "RemoveRemediationTaint" EventReasonRemoveFinalizer = "RemoveFinalizer" EventReasonAddRemediationTaint = "AddRemediationTaint" EventReasonFenceAgentExecuted = "FenceAgentExecuted" EventReasonFenceAgentSucceeded = "FenceAgentSucceeded" EventReasonDeleteResources = "DeleteResources" EventReasonAddOutOfServiceTaint = "AddOutOfServiceTaint" EventReasonRemoveOutOfServiceTaint = "RemoveOutOfServiceTaint" EventReasonNodeRemediationCompleted = "NodeRemediationCompleted" // events messages EventMessageCrNodeNotFound = "CR name doesn't match a node name" EventMessageRemediationStoppedByNHC = "Remediation was stopped by the Node Healthcheck Operator" EventMessageAddFinalizer = "Finalizer was added" EventMessageRemoveRemediationTaint = "Remediation taint was removed" EventMessageRemoveFinalizer = "Finalizer was removed" EventMessageAddRemediationTaint = "Remediation taint was added" EventMessageFenceAgentExecuted = "Fence agent was executed" EventMessageFenceAgentSucceeded = "Fence agent was succeeded" EventMessageDeleteResources = "Manually delete pods from the unhealthy node" EventMessageAddOutOfServiceTaint = "The out-of-service taint was added" EventMessageRemoveOutOfServiceTaint = "The out-of-service taint was removed" EventMessageNodeRemediationCompleted = "Unhealthy node remediation was completed" )
Variables ¶
This section is empty.
Functions ¶
func AppendTaint ¶
AppendTaint appends new taint to the taint list when it is not present. It returns bool if a taint was appended, and an error if it fails in the process
func CreateOutOfServiceTaint ¶ added in v0.4.0
CreateOutOfServiceTaint returns an OutOfService taint
func CreateRemediationTaint ¶ added in v0.3.0
CreateRemediationTaint returns a remediation NoExeucte taint
func GetDeploymentNamespace ¶
GetDeploymentNamespace returns the Namespace this operator is deployed/installed on.
func GetFenceAgentsRemediationPod ¶
GetFenceAgentsRemediationPod fetches the first running pod that matches to FAR's label and namespace The pod should be on running state since when we taint and reboot a node which had FAR, then that pod will be restarted on a different node, This results with an old pod which is about to die and new pod is already running and we want to return the running pod
func GetNode ¶
GetNode returns a node object with the name nodeName based on the nodeType input used for making new node object for test and have a unique resourceVersion
func GetNodeWithName ¶
GetNodeWithName returns a node with a name nodeName, or an error if it can't be found
func RemoveTaint ¶
RemoveTaint removes taint from the taint list when it is existed, and returns error if it fails in the process
func TaintExists ¶
TaintExists checks if the given taint exists in list of taints. Returns true if exists false otherwise.
func UpdateConditions ¶ added in v0.3.0
func UpdateConditions(reason ConditionsChangeReason, far *v1alpha1.FenceAgentsRemediation, log logr.Logger)
updateConditions updates the status conditions of a FenceAgentsRemediation object based on the provided ConditionsChangeReason. return an error if an unknown ConditionsChangeReason is provided
Types ¶
type ConditionsChangeReason ¶ added in v0.3.0
type ConditionsChangeReason string
ConditionsChangeReason represents the reason of updating the some or all the conditions
const ( // RemediationFinishedNodeNotFound - CR was found but its name doesn't match any node RemediationFinishedNodeNotFound ConditionsChangeReason = "RemediationFinishedNodeNotFound" // RemediationInterruptedByNHC - Remediation was interrupted by NHC timeout annotation RemediationInterruptedByNHC ConditionsChangeReason = "RemediationInterruptedByNHC" // RemediationStarted - CR was found, its name matches a node, and a finalizer was set RemediationStarted ConditionsChangeReason = "RemediationStarted" // FenceAgentSucceeded - FAR taint was added, fence agent command has been created and executed successfully FenceAgentSucceeded ConditionsChangeReason = "FenceAgentSucceeded" // FenceAgentFailed - Fence agent command has been created but failed to execute FenceAgentFailed ConditionsChangeReason = "FenceAgentFailed" // FenceAgentTimedOut - Fence agent command has been created but timed out FenceAgentTimedOut ConditionsChangeReason = "FenceAgentTimedOut" // RemediationFinishedSuccessfully - The unhealthy node was fully remediated/fenced (it was tainted, fenced by FA and all of its resources have been deleted) RemediationFinishedSuccessfully ConditionsChangeReason = "RemediationFinishedSuccessfully" )