sigs.k8s.io/cluster-api@v1.7.1/internal/apis/core/v1alpha3/condition_consts.go (about)

     1  /*
     2  Copyright 2020 The Kubernetes Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package v1alpha3
    18  
    19  // ANCHOR: CommonConditions
    20  
    21  // Common ConditionTypes used by Cluster API objects.
    22  const (
    23  	// ReadyCondition defines the Ready condition type that summarizes the operational state of a Cluster API object.
    24  	ReadyCondition ConditionType = "Ready"
    25  )
    26  
    27  // Common ConditionReason used by Cluster API objects.
    28  const (
    29  	// DeletingReason (Severity=Info) documents an condition not in Status=True because the underlying object it is currently being deleted.
    30  	DeletingReason = "Deleting"
    31  
    32  	// DeletionFailedReason (Severity=Warning) documents an condition not in Status=True because the underlying object
    33  	// encountered problems during deletion. This is a warning because the reconciler will retry deletion.
    34  	DeletionFailedReason = "DeletionFailed"
    35  
    36  	// DeletedReason (Severity=Info) documents an condition not in Status=True because the underlying object was deleted.
    37  	DeletedReason = "Deleted"
    38  )
    39  
    40  const (
    41  	// InfrastructureReadyCondition reports a summary of current status of the infrastructure object defined for this cluster/machine/machinepool.
    42  	// This condition is mirrored from the Ready condition in the infrastructure ref object, and
    43  	// the absence of this condition might signal problems in the reconcile external loops or the fact that
    44  	// the infrastructure provider does not implement the Ready condition yet.
    45  	InfrastructureReadyCondition ConditionType = "InfrastructureReady"
    46  
    47  	// WaitingForInfrastructureFallbackReason (Severity=Info) documents a cluster/machine/machinepool waiting for the underlying infrastructure
    48  	// to be available.
    49  	// NOTE: This reason is used only as a fallback when the infrastructure object is not reporting its own ready condition.
    50  	WaitingForInfrastructureFallbackReason = "WaitingForInfrastructure"
    51  )
    52  
    53  // ANCHOR_END: CommonConditions
    54  
    55  // Conditions and condition Reasons for the Cluster object.
    56  
    57  const (
    58  	// ControlPlaneReadyCondition reports the ready condition from the control plane object defined for this cluster.
    59  	// This condition is mirrored from the Ready condition in the control plane ref object, and
    60  	// the absence of this condition might signal problems in the reconcile external loops or the fact that
    61  	// the control plane provider does not implement the Ready condition yet.
    62  	ControlPlaneReadyCondition ConditionType = "ControlPlaneReady"
    63  
    64  	// WaitingForControlPlaneFallbackReason (Severity=Info) documents a cluster waiting for the control plane
    65  	// to be available.
    66  	// NOTE: This reason is used only as a fallback when the control plane object is not reporting its own ready condition.
    67  	WaitingForControlPlaneFallbackReason = "WaitingForControlPlane"
    68  
    69  	// WaitingForControlPlaneAvailableReason (Severity=Info) documents a Cluster API object
    70  	// waiting for the control plane machine to be available.
    71  	//
    72  	// NOTE: Having the control plane machine available is a pre-condition for joining additional control planes
    73  	// or workers nodes.
    74  	WaitingForControlPlaneAvailableReason = "WaitingForControlPlaneAvailable"
    75  )
    76  
    77  // Conditions and condition Reasons for the Machine object.
    78  
    79  const (
    80  	// BootstrapReadyCondition reports a summary of current status of the bootstrap object defined for this machine.
    81  	// This condition is mirrored from the Ready condition in the bootstrap ref object, and
    82  	// the absence of this condition might signal problems in the reconcile external loops or the fact that
    83  	// the bootstrap provider does not implement the Ready condition yet.
    84  	BootstrapReadyCondition ConditionType = "BootstrapReady"
    85  
    86  	// WaitingForDataSecretFallbackReason (Severity=Info) documents a machine waiting for the bootstrap data secret
    87  	// to be available.
    88  	// NOTE: This reason is used only as a fallback when the bootstrap object is not reporting its own ready condition.
    89  	WaitingForDataSecretFallbackReason = "WaitingForDataSecret"
    90  
    91  	// DrainingSucceededCondition provide evidence of the status of the node drain operation which happens during the machine
    92  	// deletion process.
    93  	DrainingSucceededCondition ConditionType = "DrainingSucceeded"
    94  
    95  	// DrainingReason (Severity=Info) documents a machine node being drained.
    96  	DrainingReason = "Draining"
    97  
    98  	// DrainingFailedReason (Severity=Warning) documents a machine node drain operation failed.
    99  	DrainingFailedReason = "DrainingFailed"
   100  
   101  	// PreDrainDeleteHookSucceededCondition reports a machine waiting for a PreDrainDeleteHook before being delete.
   102  	PreDrainDeleteHookSucceededCondition ConditionType = "PreDrainDeleteHookSucceeded"
   103  
   104  	// PreTerminateDeleteHookSucceededCondition reports a machine waiting for a PreDrainDeleteHook before being delete.
   105  	PreTerminateDeleteHookSucceededCondition ConditionType = "PreTerminateDeleteHookSucceeded"
   106  
   107  	// WaitingExternalHookReason (Severity=Info) provide evidence that we are waiting for an external hook to complete.
   108  	WaitingExternalHookReason = "WaitingExternalHook"
   109  )
   110  
   111  const (
   112  	// MachineHealthCheckSuccededCondition is set on machines that have passed a healthcheck by the MachineHealthCheck controller.
   113  	// In the event that the health check fails it will be set to False.
   114  	MachineHealthCheckSuccededCondition ConditionType = "HealthCheckSucceeded"
   115  
   116  	// MachineHasFailureReason is the reason used when a machine has either a FailureReason or a FailureMessage set on its status.
   117  	MachineHasFailureReason = "MachineHasFailure"
   118  
   119  	// NodeStartupTimeoutReason is the reason used when a machine's node does not appear within the specified timeout.
   120  	NodeStartupTimeoutReason = "NodeStartupTimeout"
   121  
   122  	// UnhealthyNodeConditionReason is the reason used when a machine's node has one of the MachineHealthCheck's unhealthy conditions.
   123  	UnhealthyNodeConditionReason = "UnhealthyNode"
   124  )
   125  
   126  const (
   127  	// MachineOwnerRemediatedCondition is set on machines that have failed a healthcheck by the MachineHealthCheck controller.
   128  	// MachineOwnerRemediatedCondition is set to False after a health check fails, but should be changed to True by the owning controller after remediation succeeds.
   129  	MachineOwnerRemediatedCondition ConditionType = "OwnerRemediated"
   130  
   131  	// WaitingForRemediationReason is the reason used when a machine fails a health check and remediation is needed.
   132  	WaitingForRemediationReason = "WaitingForRemediation"
   133  
   134  	// RemediationFailedReason is the reason used when a remediation owner fails to remediate an unhealthy machine.
   135  	RemediationFailedReason = "RemediationFailed"
   136  
   137  	// RemediationInProgressReason is the reason used when an unhealthy machine is being remediated by the remediation owner.
   138  	RemediationInProgressReason = "RemediationInProgress"
   139  
   140  	// ExternalRemediationTemplateAvailable is set on machinehealthchecks when MachineHealthCheck controller uses external remediation.
   141  	// ExternalRemediationTemplateAvailable is set to false if external remediation template is not found.
   142  	ExternalRemediationTemplateAvailable ConditionType = "ExternalRemediationTemplateAvailable"
   143  
   144  	// ExternalRemediationTemplateNotFound is the reason used when a machine health check fails to find external remediation template.
   145  	ExternalRemediationTemplateNotFound = "ExternalRemediationTemplateNotFound"
   146  
   147  	// ExternalRemediationRequestAvailable is set on machinehealthchecks when MachineHealthCheck controller uses external remediation.
   148  	// ExternalRemediationRequestAvailable is set to false if creating external remediation request fails.
   149  	ExternalRemediationRequestAvailable ConditionType = "ExternalRemediationRequestAvailable"
   150  
   151  	// ExternalRemediationRequestCreationFailed is the reason used when a machine health check fails to create external remediation request.
   152  	ExternalRemediationRequestCreationFailed = "ExternalRemediationRequestCreationFailed"
   153  )
   154  
   155  // Conditions and condition Reasons for the Machine's Node object.
   156  const (
   157  	// MachineNodeHealthyCondition provides info about the operational state of the Kubernetes node hosted on the machine by summarizing  node conditions.
   158  	// If the conditions defined in a Kubernetes node (i.e., NodeReady, NodeMemoryPressure, NodeDiskPressure, NodePIDPressure, and NodeNetworkUnavailable) are in a healthy state, it will be set to True.
   159  	MachineNodeHealthyCondition ConditionType = "NodeHealthy"
   160  
   161  	// WaitingForNodeRefReason (Severity=Info) documents a machine.spec.providerId is not assigned yet.
   162  	WaitingForNodeRefReason = "WaitingForNodeRef"
   163  
   164  	// NodeProvisioningReason (Severity=Info) documents machine in the process of provisioning a node.
   165  	// NB. provisioning --> NodeRef == "".
   166  	NodeProvisioningReason = "NodeProvisioning"
   167  
   168  	// NodeNotFoundReason (Severity=Error) documents a machine's node has previously been observed but is now gone.
   169  	// NB. provisioned --> NodeRef != "".
   170  	NodeNotFoundReason = "NodeNotFound"
   171  
   172  	// NodeConditionsFailedReason (Severity=Warning) documents a node is not in a healthy state due to the failed state of at least 1 Kubelet condition.
   173  	NodeConditionsFailedReason = "NodeConditionsFailed"
   174  )
   175  
   176  // Conditions and condition Reasons for the MachineHealthCheck object.
   177  
   178  const (
   179  	// RemediationAllowedCondition is set on MachineHealthChecks to show the status of whether the MachineHealthCheck is
   180  	// allowed to remediate any Machines or whether it is blocked from remediating any further.
   181  	RemediationAllowedCondition ConditionType = "RemediationAllowed"
   182  
   183  	// TooManyUnhealthyReason is the reason used when too many Machines are unhealthy and the MachineHealthCheck is blocked
   184  	// from making any further remediations.
   185  	TooManyUnhealthyReason = "TooManyUnhealthy"
   186  )