in spark-operator/src/main/java/org/apache/spark/k8s/operator/metrics/healthcheck/SentinelManager.java [104:129]
public void checkHealth(ResourceID resourceID, KubernetesClient client) {
SentinelResourceState sentinelResourceState = sentinelResources.get(resourceID);
if (sentinelResourceState == null) {
if (log.isErrorEnabled()) {
log.error("Sentinel resources {} not found. Stopping sentinel health checks", resourceID);
}
return;
}
if (sentinelResourceState.reconciledSinceUpdate()) {
log.info("Sentinel reports healthy state globally");
sentinelResourceState.isHealthy = true;
} else {
if (log.isErrorEnabled()) {
log.error(
"Sentinel deployment {} latest spec not was reconciled. Expected "
+ "generation larger than {}, received {}",
resourceID,
sentinelResourceState.previousGeneration,
sentinelResourceState.resource.getMetadata().getGeneration());
}
sentinelResourceState.isHealthy = false;
}
updateSpecAndScheduleHealthCheck(resourceID, sentinelResourceState, client);
}