Class Readiness
- java.lang.Object
-
- io.fabric8.kubernetes.client.readiness.Readiness
-
public class Readiness extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringREADINESS_APPLICABLE_RESOURCES
-
Constructor Summary
Constructors Constructor Description Readiness()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ReadinessgetInstance()protected StringgetReadinessResourcesList()static booleanisDeploymentReady(io.fabric8.kubernetes.api.model.apps.Deployment d)static booleanisEndpointsReady(io.fabric8.kubernetes.api.model.Endpoints e)static booleanisExtensionsDeploymentReady(io.fabric8.kubernetes.api.model.extensions.Deployment d)static booleanisNodeReady(io.fabric8.kubernetes.api.model.Node node)static booleanisPodReady(io.fabric8.kubernetes.api.model.Pod pod)static booleanisPodSucceeded(io.fabric8.kubernetes.api.model.Pod pod)Returns true if the Pod.status.phase is 'Succeeded'.protected booleanisReadinessApplicable(io.fabric8.kubernetes.api.model.HasMetadata item)booleanisReady(io.fabric8.kubernetes.api.model.HasMetadata item)Checks if the providedHasMetadatais marked as ready by the cluster.static booleanisReplicaSetReady(io.fabric8.kubernetes.api.model.apps.ReplicaSet r)static booleanisReplicationControllerReady(io.fabric8.kubernetes.api.model.ReplicationController r)protected booleanisResourceReady(io.fabric8.kubernetes.api.model.HasMetadata item)static booleanisStatefulSetReady(io.fabric8.kubernetes.api.model.apps.StatefulSet ss)
-
-
-
Field Detail
-
READINESS_APPLICABLE_RESOURCES
protected static final String READINESS_APPLICABLE_RESOURCES
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static Readiness getInstance()
-
isReady
public boolean isReady(io.fabric8.kubernetes.api.model.HasMetadata item)
Checks if the providedHasMetadatais marked as ready by the cluster.A "Readiable" resources is a subjective trait for Kubernetes Resources. Many Resources, such as ConfigMaps, Secrets, etc. become ready as soon as they've been created in the cluster.
However, other resources such as Pods, Endpoints, Deployments, and controllers in general, only become ready when their desired state matches their actual state.
This method returns true for those "Readiable" resources once they are considered ready (even if the resource exists in the cluster). For "non-Readiable" resources, this method returns true once the resources are created in the cluster (in addition it logs a warning stating that the given resource is not considered "Readiable").
- Parameters:
item- resource to be checked for Readiness.- Returns:
- true if it's a Readiable Resource and is ready, or it's a non-readiable resource and has been created. false otherwise.
-
isReadinessApplicable
protected boolean isReadinessApplicable(io.fabric8.kubernetes.api.model.HasMetadata item)
-
isResourceReady
protected boolean isResourceReady(io.fabric8.kubernetes.api.model.HasMetadata item)
-
getReadinessResourcesList
protected String getReadinessResourcesList()
-
isStatefulSetReady
public static boolean isStatefulSetReady(io.fabric8.kubernetes.api.model.apps.StatefulSet ss)
-
isDeploymentReady
public static boolean isDeploymentReady(io.fabric8.kubernetes.api.model.apps.Deployment d)
-
isExtensionsDeploymentReady
public static boolean isExtensionsDeploymentReady(io.fabric8.kubernetes.api.model.extensions.Deployment d)
-
isReplicaSetReady
public static boolean isReplicaSetReady(io.fabric8.kubernetes.api.model.apps.ReplicaSet r)
-
isReplicationControllerReady
public static boolean isReplicationControllerReady(io.fabric8.kubernetes.api.model.ReplicationController r)
-
isEndpointsReady
public static boolean isEndpointsReady(io.fabric8.kubernetes.api.model.Endpoints e)
-
isPodReady
public static boolean isPodReady(io.fabric8.kubernetes.api.model.Pod pod)
-
isPodSucceeded
public static boolean isPodSucceeded(io.fabric8.kubernetes.api.model.Pod pod)
Returns true if the Pod.status.phase is 'Succeeded'.- Parameters:
pod- the Pod to check the status phase of- Returns:
- true if the Pod is succeeded, false otherwise
-
isNodeReady
public static boolean isNodeReady(io.fabric8.kubernetes.api.model.Node node)
-
-