You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by do...@apache.org on 2026/09/16 14:18:04 UTC

(spark-kubernetes-operator) branch main updated: [SPARK-59502] Support K8s `Warning` events for `SparkApplication` and `SparkCluster` failures

This is an automated email from the ASF dual-hosted git repository.

dongjoon-hyun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/spark-kubernetes-operator.git


The following commit(s) were added to refs/heads/main by this push:
     new d3839570 [SPARK-59502] Support K8s `Warning` events for `SparkApplication` and `SparkCluster` failures
d3839570 is described below

commit d38395708b2d0819317f717ed0ce6aad84cc5a9f
Author: Qi Tan <16...@users.noreply.github.com>
AuthorDate: Wed Sep 16 07:17:56 2026 -0700

    [SPARK-59502] Support K8s `Warning` events for `SparkApplication` and `SparkCluster` failures
    
    ### What changes were proposed in this pull request?
    This PR aims to support publishing Kubernetes `Warning` events for `SparkApplication` and `SparkCluster` failures. The events are written into the namespace of the failed resource, so they show up under `kubectl describe` and `kubectl get events`.
    
    The feature is disabled by default and is controlled by a new dynamic config, `spark.kubernetes.operator.events.enabled`.
    
    | Reason | When |
    |---|---|
    | Failure state name | A resource transitions into a failure state. For `SparkApplication`, these are `SchedulingFailure`, `Failed`, `DriverEvicted`, `DriverStartTimedOut`, `DriverReadyTimedOut` and `ExecutorsStartTimedOut`. For `SparkCluster`, these are `SchedulingFailure` and `Failed`. |
    | `ReconcileError` | A reconciliation throws. Only the first attempt of a failure episode publishes. |
    | `CleanupError` | A cleanup throws, so the resource cannot finish deleting. |
    | `StatusUpdateFailed` | A status patch is rejected. Transport-level errors (timeouts, `502`, `503`, `504`) are skipped. |
    
    Implementation notes:
    - `ConfigurableEventRecorder` wraps the JOSDK default recorder and is registered once via `ConfigurationServiceOverrider.withEventRecorder`. It reads the config per event, so the dynamic override takes effect at runtime.
    - Failure-state events are emitted from `StatusRecorder` after a status patch succeeds and only when the status actually changed.
    - Each event uses its reason as the JOSDK event key, so repeated occurrences increment the count of one `Event` object.
    - `BaseContext` now holds the JOSDK context and provides `getClient()` and `getEventRecorder()`.
    
    Normal lifecycle events (for example, `DriverRequested`, `RunningHealthy` and `Succeeded`) are out of scope for this PR.
    
    ### Why are the changes needed?
    Most user-facing failures, such as a rejected driver pod or a driver start timeout, are recorded only in the custom resource status and the operator log. Publishing them as `Warning` events makes them visible through the standard Kubernetes tooling.
    
    ### Does this PR introduce _any_ user-facing change?
    No behavior change by default. When `spark.kubernetes.operator.events.enabled` is `true`, the operator publishes the `Warning` events listed above. The existing Helm RBAC already grants the required permissions on `events`.
    
    ### How was this patch tested?
    Pass the CIs with the newly added unit tests. It was also manually tested on a Kubernetes cluster.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    Generated-by: Claude Code
    
    Closes #826 from TQJADE/event-record-oss.
    
    Authored-by: Qi Tan <16...@users.noreply.github.com>
    Signed-off-by: Dongjoon Hyun <do...@apache.org>
---
 docs/config_properties.md                          |   1 +
 .../k8s/operator/status/BaseStateSummary.java      |   9 ++
 .../apache/spark/k8s/operator/SparkOperator.java   |   2 +
 .../k8s/operator/config/SparkOperatorConf.java     |  21 +++
 .../spark/k8s/operator/context/BaseContext.java    |  30 ++++-
 .../k8s/operator/context/SparkAppContext.java      |  30 +++--
 .../k8s/operator/context/SparkClusterContext.java  |  30 +++--
 .../operator/reconciler/SparkAppReconciler.java    |  18 +++
 .../reconciler/SparkClusterReconciler.java         |  18 +++
 .../operator/utils/ConfigurableEventRecorder.java  | 115 ++++++++++++++++
 .../spark/k8s/operator/utils/EventUtils.java       | 145 +++++++++++++++++++++
 .../spark/k8s/operator/utils/ReconcilerUtils.java  |  22 +++-
 .../spark/k8s/operator/utils/StatusRecorder.java   |  47 ++++++-
 .../reconciler/SparkAppReconcilerTest.java         |  67 ++++++++++
 .../reconciler/SparkClusterReconcilerTest.java     |  68 ++++++++++
 .../utils/ConfigurableEventRecorderTest.java       | 115 ++++++++++++++++
 .../spark/k8s/operator/utils/EventUtilsTest.java   | 137 +++++++++++++++++++
 .../k8s/operator/utils/StatusRecorderTest.java     | 118 +++++++++++++++++
 18 files changed, 959 insertions(+), 34 deletions(-)

diff --git a/docs/config_properties.md b/docs/config_properties.md
index 10a0782b..0a701893 100644
--- a/docs/config_properties.md
+++ b/docs/config_properties.md
@@ -16,6 +16,7 @@
  | spark.kubernetes.operator.dynamicConfig.reloadIntervalSeconds | Long | 60 | false | Interval (in seconds) at which the dynamic config file is re-read. Used by the 'file' source. | 
  | spark.kubernetes.operator.dynamicConfig.selector | String | app.kubernetes.io/name=spark-kubernetes-operator,app.kubernetes.io/component=operator-dynamic-config-overrides | false | The selector str applied to dynamic config map. Used by the 'configMap' source. | 
  | spark.kubernetes.operator.dynamicConfig.source | String | configMap | false | Source of dynamic config overrides when spark.kubernetes.operator.dynamicConfig.enabled is true. Supported values: 'configMap' (default) watches a ConfigMap via a Kubernetes informer and requires RBAC to read ConfigMaps; 'file' periodically reloads a properties file mounted from a ConfigMap and requires no extra RBAC. | 
+ | spark.kubernetes.operator.events.enabled | Boolean | false | true | When enabled, operator would publish Kubernetes Event objects into the namespace of the Spark resource they describe, making them visible to users of that namespace via 'kubectl describe' and 'kubectl get events'. Events are published when a resource enters a failure state, and when the operator cannot reconcile or update the status of a resource. These are Event resources in the core API group, unrelated to the inter [...]
  | spark.kubernetes.operator.health.probePort | Integer | 19091 | false | The port used for health/readiness check probe status. | 
  | spark.kubernetes.operator.health.sentinelExecutorPoolSize | Integer | 3 | false | Size of executor service in Sentinel Managers to check the health of sentinel resources. | 
  | spark.kubernetes.operator.health.sentinelResourceReconciliationDelaySeconds | Integer | 60 | true | Allowed max time(seconds) between spec update and reconciliation for sentinel resources. | 
diff --git a/spark-operator-api/src/main/java/org/apache/spark/k8s/operator/status/BaseStateSummary.java b/spark-operator-api/src/main/java/org/apache/spark/k8s/operator/status/BaseStateSummary.java
index deb8b0de..ad5315bc 100644
--- a/spark-operator-api/src/main/java/org/apache/spark/k8s/operator/status/BaseStateSummary.java
+++ b/spark-operator-api/src/main/java/org/apache/spark/k8s/operator/status/BaseStateSummary.java
@@ -26,6 +26,15 @@ package org.apache.spark.k8s.operator.status;
  */
 public sealed interface BaseStateSummary
     permits ApplicationStateSummary, ClusterStateSummary {
+  /**
+   * The stable CamelCase name of this state. Both permitted implementations are enums, so this is
+   * satisfied by {@link Enum#name()}. Declaring it here lets callers that only hold a {@link
+   * BaseStateSummary} use the state name, for example as the reason of a Kubernetes Event.
+   *
+   * @return The name of this state.
+   */
+  String name();
+
   /**
    * Checks if the CustomResource has failed.
    *
diff --git a/spark-operator/src/main/java/org/apache/spark/k8s/operator/SparkOperator.java b/spark-operator/src/main/java/org/apache/spark/k8s/operator/SparkOperator.java
index fb3c7f2f..0463200f 100644
--- a/spark-operator/src/main/java/org/apache/spark/k8s/operator/SparkOperator.java
+++ b/spark-operator/src/main/java/org/apache/spark/k8s/operator/SparkOperator.java
@@ -58,6 +58,7 @@ import org.apache.spark.k8s.operator.metrics.source.OperatorJosdkMetrics;
 import org.apache.spark.k8s.operator.probe.ProbeService;
 import org.apache.spark.k8s.operator.reconciler.SparkAppReconciler;
 import org.apache.spark.k8s.operator.reconciler.SparkClusterReconciler;
+import org.apache.spark.k8s.operator.utils.ConfigurableEventRecorder;
 import org.apache.spark.k8s.operator.utils.SparkAppStatusRecorder;
 import org.apache.spark.k8s.operator.utils.SparkClusterStatusRecorder;
 import org.apache.spark.k8s.operator.utils.StringUtils;
@@ -274,6 +275,7 @@ public class SparkOperator {
    */
   protected void overrideOperatorConfigs(ConfigurationServiceOverrider overrider) {
     overrider.withKubernetesClient(client);
+    overrider.withEventRecorder(ConfigurableEventRecorder.withDefaultSink(client));
     overrider.withStopOnInformerErrorDuringStartup(
         SparkOperatorConf.TERMINATE_ON_INFORMER_FAILURE_ENABLED.getValue());
     overrider.withReconciliationTerminationTimeout(
diff --git a/spark-operator/src/main/java/org/apache/spark/k8s/operator/config/SparkOperatorConf.java b/spark-operator/src/main/java/org/apache/spark/k8s/operator/config/SparkOperatorConf.java
index 1ec6c548..96591816 100644
--- a/spark-operator/src/main/java/org/apache/spark/k8s/operator/config/SparkOperatorConf.java
+++ b/spark-operator/src/main/java/org/apache/spark/k8s/operator/config/SparkOperatorConf.java
@@ -277,6 +277,27 @@ public final class SparkOperatorConf {
           .defaultValue(true)
           .build();
 
+  /**
+   * When enabled, operator would publish Kubernetes Event objects into the namespace of the Spark
+   * resource they describe, making them visible to users of that namespace via 'kubectl describe'
+   * and 'kubectl get events'.
+   */
+  public static final ConfigOption<Boolean> KUBERNETES_EVENTS_ENABLED =
+      ConfigOption.<Boolean>builder()
+          .key("spark.kubernetes.operator.events.enabled")
+          .enableDynamicOverride(true)
+          .description(
+              "When enabled, operator would publish Kubernetes Event objects into the namespace "
+                  + "of the Spark resource they describe, making them visible to users of that "
+                  + "namespace via 'kubectl describe' and 'kubectl get events'. Events are "
+                  + "published when a resource enters a failure state, and when the operator "
+                  + "cannot reconcile or update the status of a resource. These are Event "
+                  + "resources in the core API group, unrelated to the internal events that "
+                  + "trigger reconciliation.")
+          .typeParameterClass(Boolean.class)
+          .defaultValue(false)
+          .build();
+
   /** Comma-separated names of SparkAppStatusListener class implementations */
   public static final ConfigOption<String> SPARK_APP_STATUS_LISTENER_CLASS_NAMES =
       ConfigOption.<String>builder()
diff --git a/spark-operator/src/main/java/org/apache/spark/k8s/operator/context/BaseContext.java b/spark-operator/src/main/java/org/apache/spark/k8s/operator/context/BaseContext.java
index 3e201d4c..8fe1c80c 100644
--- a/spark-operator/src/main/java/org/apache/spark/k8s/operator/context/BaseContext.java
+++ b/spark-operator/src/main/java/org/apache/spark/k8s/operator/context/BaseContext.java
@@ -20,6 +20,8 @@
 package org.apache.spark.k8s.operator.context;
 
 import io.fabric8.kubernetes.client.KubernetesClient;
+import io.javaoperatorsdk.operator.api.event.ResourceEventRecorder;
+import io.javaoperatorsdk.operator.api.reconciler.Context;
 
 import org.apache.spark.k8s.operator.BaseResource;
 
@@ -29,6 +31,19 @@ import org.apache.spark.k8s.operator.BaseResource;
  * @param <CR> The type of the custom resource.
  */
 public abstract class BaseContext<CR extends BaseResource<?, ?, ?, ?, ?>> {
+
+  /** The JOSDK context of the reconciliation this context belongs to. */
+  protected final Context<?> josdkContext;
+
+  /**
+   * Constructs a context over the given JOSDK reconciliation context.
+   *
+   * @param josdkContext The JOSDK context of the current reconciliation.
+   */
+  protected BaseContext(Context<?> josdkContext) {
+    this.josdkContext = josdkContext;
+  }
+
   /**
    * Returns the custom resource associated with this context.
    *
@@ -41,5 +56,18 @@ public abstract class BaseContext<CR extends BaseResource<?, ?, ?, ?, ?>> {
    *
    * @return The Kubernetes client.
    */
-  public abstract KubernetesClient getClient();
+  public KubernetesClient getClient() {
+    return josdkContext.getClient();
+  }
+
+  /**
+   * Returns the event recorder bound to the resource associated with this context. Recording an
+   * event is best effort: the recorder drops the event when publishing is disabled, and logs and
+   * swallows write failures.
+   *
+   * @return The event recorder.
+   */
+  public ResourceEventRecorder getEventRecorder() {
+    return josdkContext.eventRecorder();
+  }
 }
diff --git a/spark-operator/src/main/java/org/apache/spark/k8s/operator/context/SparkAppContext.java b/spark-operator/src/main/java/org/apache/spark/k8s/operator/context/SparkAppContext.java
index 9c5ee681..44414907 100644
--- a/spark-operator/src/main/java/org/apache/spark/k8s/operator/context/SparkAppContext.java
+++ b/spark-operator/src/main/java/org/apache/spark/k8s/operator/context/SparkAppContext.java
@@ -29,10 +29,8 @@ import java.util.stream.Collectors;
 
 import io.fabric8.kubernetes.api.model.HasMetadata;
 import io.fabric8.kubernetes.api.model.Pod;
-import io.fabric8.kubernetes.client.KubernetesClient;
 import io.fabric8.kubernetes.client.KubernetesClientException;
 import io.javaoperatorsdk.operator.api.reconciler.Context;
-import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 
 import org.apache.spark.k8s.operator.SparkAppResourceSpec;
@@ -44,11 +42,9 @@ import org.apache.spark.k8s.operator.reconciler.SparkAppResourceSpecFactory;
  * Context for {@link org.apache.spark.k8s.operator.SparkApplication} resource, including secondary
  * resource(s) and desired secondary resource spec
  */
-@RequiredArgsConstructor
 @Slf4j
 public class SparkAppContext extends BaseContext<SparkApplication> {
   private final SparkApplication sparkApplication;
-  private final Context<?> josdkContext;
   private final SparkAppSubmissionWorker submissionWorker;
 
   /** secondaryResourceSpec is initialized in a lazy fashion - built upon the first attempt */
@@ -57,6 +53,22 @@ public class SparkAppContext extends BaseContext<SparkApplication> {
   /** driverPodFromApi is initialized in a lazy fashion - built upon the first attempt */
   private Optional<Pod> driverPodFromApi;
 
+  /**
+   * Constructs a context for the given SparkApplication.
+   *
+   * @param sparkApplication The SparkApplication being reconciled.
+   * @param josdkContext The JOSDK context of the current reconciliation.
+   * @param submissionWorker The worker that builds the secondary resource spec.
+   */
+  public SparkAppContext(
+      SparkApplication sparkApplication,
+      Context<?> josdkContext,
+      SparkAppSubmissionWorker submissionWorker) {
+    super(josdkContext);
+    this.sparkApplication = sparkApplication;
+    this.submissionWorker = submissionWorker;
+  }
+
   /**
    * Returns the driver pod for the Spark application, if present.
    *
@@ -191,16 +203,6 @@ public class SparkAppContext extends BaseContext<SparkApplication> {
     return sparkApplication;
   }
 
-  /**
-   * Returns the Kubernetes client from the JOSDK context.
-   *
-   * @return The KubernetesClient instance.
-   */
-  @Override
-  public KubernetesClient getClient() {
-    return josdkContext.getClient();
-  }
-
   /**
    * Returns a list of pre-driver resources specifications.
    *
diff --git a/spark-operator/src/main/java/org/apache/spark/k8s/operator/context/SparkClusterContext.java b/spark-operator/src/main/java/org/apache/spark/k8s/operator/context/SparkClusterContext.java
index 88eadae3..9b39279b 100644
--- a/spark-operator/src/main/java/org/apache/spark/k8s/operator/context/SparkClusterContext.java
+++ b/spark-operator/src/main/java/org/apache/spark/k8s/operator/context/SparkClusterContext.java
@@ -26,9 +26,7 @@ import io.fabric8.kubernetes.api.model.apps.StatefulSet;
 import io.fabric8.kubernetes.api.model.autoscaling.v2.HorizontalPodAutoscaler;
 import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicy;
 import io.fabric8.kubernetes.api.model.policy.v1.PodDisruptionBudget;
-import io.fabric8.kubernetes.client.KubernetesClient;
 import io.javaoperatorsdk.operator.api.reconciler.Context;
-import lombok.RequiredArgsConstructor;
 
 import org.apache.spark.k8s.operator.SparkCluster;
 import org.apache.spark.k8s.operator.SparkClusterResourceSpec;
@@ -39,15 +37,29 @@ import org.apache.spark.k8s.operator.reconciler.SparkClusterResourceSpecFactory;
  * Context for {@link SparkCluster} resource, including secondary resource(s) and desired secondary
  * resource spec
  */
-@RequiredArgsConstructor
 public class SparkClusterContext extends BaseContext<SparkCluster> {
   private final SparkCluster sparkCluster;
-  private final Context<?> josdkContext;
   private final SparkClusterSubmissionWorker submissionWorker;
 
   /** secondaryResourceSpec is initialized in a lazy fashion - built upon the first attempt */
   private SparkClusterResourceSpec secondaryResourceSpec;
 
+  /**
+   * Constructs a context for the given SparkCluster.
+   *
+   * @param sparkCluster The SparkCluster being reconciled.
+   * @param josdkContext The JOSDK context of the current reconciliation.
+   * @param submissionWorker The worker that builds the secondary resource spec.
+   */
+  public SparkClusterContext(
+      SparkCluster sparkCluster,
+      Context<?> josdkContext,
+      SparkClusterSubmissionWorker submissionWorker) {
+    super(josdkContext);
+    this.sparkCluster = sparkCluster;
+    this.submissionWorker = submissionWorker;
+  }
+
   private SparkClusterResourceSpec getSecondaryResourceSpec() {
     synchronized (this) {
       if (secondaryResourceSpec == null) {
@@ -130,14 +142,4 @@ public class SparkClusterContext extends BaseContext<SparkCluster> {
   public Optional<PodDisruptionBudget> getPodDisruptionBudgetSpec() {
     return getSecondaryResourceSpec().getPodDisruptionBudget();
   }
-
-  /**
-   * Returns the Kubernetes client from the JOSDK context.
-   *
-   * @return The KubernetesClient instance.
-   */
-  @Override
-  public KubernetesClient getClient() {
-    return josdkContext.getClient();
-  }
 }
diff --git a/spark-operator/src/main/java/org/apache/spark/k8s/operator/reconciler/SparkAppReconciler.java b/spark-operator/src/main/java/org/apache/spark/k8s/operator/reconciler/SparkAppReconciler.java
index f0b270a0..29249454 100644
--- a/spark-operator/src/main/java/org/apache/spark/k8s/operator/reconciler/SparkAppReconciler.java
+++ b/spark-operator/src/main/java/org/apache/spark/k8s/operator/reconciler/SparkAppReconciler.java
@@ -21,6 +21,7 @@ package org.apache.spark.k8s.operator.reconciler;
 
 import static org.apache.spark.k8s.operator.Constants.LABEL_SPARK_APPLICATION_NAME;
 import static org.apache.spark.k8s.operator.reconciler.ReconcileProgress.completeAndDefaultRequeue;
+import static org.apache.spark.k8s.operator.utils.ReconcilerUtils.isFirstAttempt;
 import static org.apache.spark.k8s.operator.utils.Utils.basicLabelSecondaryToPrimaryMapper;
 import static org.apache.spark.k8s.operator.utils.Utils.commonResourceLabelsStr;
 
@@ -57,6 +58,7 @@ import org.apache.spark.k8s.operator.reconciler.reconcilesteps.AppResourceObserv
 import org.apache.spark.k8s.operator.reconciler.reconcilesteps.AppRunningStep;
 import org.apache.spark.k8s.operator.reconciler.reconcilesteps.AppUnknownStateStep;
 import org.apache.spark.k8s.operator.reconciler.reconcilesteps.AppValidateStep;
+import org.apache.spark.k8s.operator.utils.EventUtils;
 import org.apache.spark.k8s.operator.utils.LoggingUtils;
 import org.apache.spark.k8s.operator.utils.ReconcilerUtils;
 import org.apache.spark.k8s.operator.utils.SparkAppStatusRecorder;
@@ -135,6 +137,15 @@ public class SparkAppReconciler implements Reconciler<SparkApplication>, Cleaner
                       retryInfo.isLastAttempt());
                 }
               });
+      // JOSDK calls this on every retry attempt. Emitting each time would mean one blocking write
+      // per attempt against an API server that is often the cause of the failure, so only the
+      // first attempt publishes: the reason is stable, so a later attempt would only bump a count.
+      if (isFirstAttempt(context)) {
+        EventUtils.warn(
+            context.eventRecorder(),
+            EventUtils.REASON_RECONCILE_ERROR,
+            "Spark App Reconciliation failed. " + EventUtils.describe(e));
+      }
       return ErrorStatusUpdateControl.noStatusUpdate();
     } finally {
       trackedMDC.reset();
@@ -223,6 +234,13 @@ public class SparkAppReconciler implements Reconciler<SparkApplication>, Cleaner
           }
         }
       }
+    } catch (RuntimeException e) {
+      EventUtils.warn(
+          context.eventRecorder(),
+          EventUtils.REASON_CLEANUP_ERROR,
+          "Spark App Cleanup failed, the resource cannot finish deleting. "
+              + EventUtils.describe(e));
+      throw e;
     } finally {
       log.debug("Cleanup completed");
       trackedMDC.reset();
diff --git a/spark-operator/src/main/java/org/apache/spark/k8s/operator/reconciler/SparkClusterReconciler.java b/spark-operator/src/main/java/org/apache/spark/k8s/operator/reconciler/SparkClusterReconciler.java
index 02022b64..bdfc5fb1 100644
--- a/spark-operator/src/main/java/org/apache/spark/k8s/operator/reconciler/SparkClusterReconciler.java
+++ b/spark-operator/src/main/java/org/apache/spark/k8s/operator/reconciler/SparkClusterReconciler.java
@@ -21,6 +21,7 @@ package org.apache.spark.k8s.operator.reconciler;
 
 import static org.apache.spark.k8s.operator.Constants.LABEL_SPARK_APPLICATION_NAME;
 import static org.apache.spark.k8s.operator.reconciler.ReconcileProgress.completeAndDefaultRequeue;
+import static org.apache.spark.k8s.operator.utils.ReconcilerUtils.isFirstAttempt;
 import static org.apache.spark.k8s.operator.utils.Utils.basicLabelSecondaryToPrimaryMapper;
 import static org.apache.spark.k8s.operator.utils.Utils.commonResourceLabelsStr;
 
@@ -47,6 +48,7 @@ import org.apache.spark.k8s.operator.SparkClusterSubmissionWorker;
 import org.apache.spark.k8s.operator.context.SparkClusterContext;
 import org.apache.spark.k8s.operator.metrics.healthcheck.SentinelManager;
 import org.apache.spark.k8s.operator.reconciler.reconcilesteps.*;
+import org.apache.spark.k8s.operator.utils.EventUtils;
 import org.apache.spark.k8s.operator.utils.LoggingUtils;
 import org.apache.spark.k8s.operator.utils.ReconcilerUtils;
 import org.apache.spark.k8s.operator.utils.SparkClusterStatusRecorder;
@@ -122,6 +124,15 @@ public class SparkClusterReconciler implements Reconciler<SparkCluster>, Cleaner
                       retryInfo.isLastAttempt());
                 }
               });
+      // JOSDK calls this on every retry attempt. Emitting each time would mean one blocking write
+      // per attempt against an API server that is often the cause of the failure, so only the
+      // first attempt publishes: the reason is stable, so a later attempt would only bump a count.
+      if (isFirstAttempt(context)) {
+        EventUtils.warn(
+            context.eventRecorder(),
+            EventUtils.REASON_RECONCILE_ERROR,
+            "Spark Cluster Reconciliation failed. " + EventUtils.describe(e));
+      }
       return ErrorStatusUpdateControl.noStatusUpdate();
     } finally {
       trackedMDC.reset();
@@ -198,6 +209,13 @@ public class SparkClusterReconciler implements Reconciler<SparkCluster>, Cleaner
           }
         }
       }
+    } catch (RuntimeException e) {
+      EventUtils.warn(
+          context.eventRecorder(),
+          EventUtils.REASON_CLEANUP_ERROR,
+          "Spark Cluster Cleanup failed, the resource cannot finish deleting. "
+              + EventUtils.describe(e));
+      throw e;
     } finally {
       log.info("Cleanup completed");
       trackedMDC.reset();
diff --git a/spark-operator/src/main/java/org/apache/spark/k8s/operator/utils/ConfigurableEventRecorder.java b/spark-operator/src/main/java/org/apache/spark/k8s/operator/utils/ConfigurableEventRecorder.java
new file mode 100644
index 00000000..6caafa59
--- /dev/null
+++ b/spark-operator/src/main/java/org/apache/spark/k8s/operator/utils/ConfigurableEventRecorder.java
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.spark.k8s.operator.utils;
+
+import static org.apache.spark.k8s.operator.config.SparkOperatorConf.KUBERNETES_EVENTS_ENABLED;
+
+import io.fabric8.kubernetes.client.KubernetesClient;
+import io.javaoperatorsdk.operator.api.event.DefaultEventRecorder;
+import io.javaoperatorsdk.operator.api.event.DefaultEventSink;
+import io.javaoperatorsdk.operator.api.event.EventRecord;
+import io.javaoperatorsdk.operator.api.event.EventRecorder;
+import io.javaoperatorsdk.operator.api.event.ResourceEventRecorder;
+import io.javaoperatorsdk.operator.api.reconciler.Context;
+
+/**
+ * An {@link EventRecorder} that drops every event unless {@link
+ * org.apache.spark.k8s.operator.config.SparkOperatorConf#KUBERNETES_EVENTS_ENABLED} is set.
+ *
+ * <p>Registered once for the whole operator via {@link
+ * io.javaoperatorsdk.operator.api.config.ConfigurationServiceOverrider#withEventRecorder}, so that
+ * {@link Context#eventRecorder()} is safe to call unconditionally and no caller has to read the
+ * config itself. The flag is read per emitted event rather than when the recorder is bound to a
+ * context, which keeps its dynamic override responsive within a running reconciliation.
+ */
+public class ConfigurableEventRecorder implements EventRecorder {
+
+  private final EventRecorder delegate;
+
+  /**
+   * Constructs a recorder that forwards to the given delegate while events are enabled.
+   *
+   * @param delegate The recorder that assembles and writes the events.
+   */
+  public ConfigurableEventRecorder(EventRecorder delegate) {
+    this.delegate = delegate;
+  }
+
+  /**
+   * Constructs a recorder over the JOSDK defaults, writing events with the given client.
+   *
+   * @param client The Kubernetes client used to write events.
+   * @return A recorder gated on the events config option.
+   */
+  public static ConfigurableEventRecorder withDefaultSink(KubernetesClient client) {
+    return new ConfigurableEventRecorder(new DefaultEventRecorder(new DefaultEventSink(client)));
+  }
+
+  /**
+   * Records the given event, unless event publishing is disabled.
+   *
+   * @param event The event to record.
+   * @param context The reconciliation the event is recorded from.
+   */
+  @Override
+  public void record(EventRecord event, Context<?> context) {
+    if (!eventsEnabled()) {
+      return;
+    }
+    delegate.record(event, context);
+  }
+
+  /**
+   * Returns a recorder bound to the given context. Binding is always allowed, the enabled flag is
+   * consulted when an event is actually recorded.
+   *
+   * @param context The reconciliation to bind to.
+   * @return A recorder bound to the primary resource of the given context.
+   */
+  @Override
+  public ResourceEventRecorder forContext(Context<?> context) {
+    return new BoundRecorder(this, context);
+  }
+
+  private static boolean eventsEnabled() {
+    // Boolean.TRUE.equals guards against a null resolved value, which the option can yield for a
+    // malformed override. Publishing events must never break a reconciliation.
+    return Boolean.TRUE.equals(KUBERNETES_EVENTS_ENABLED.getValue());
+  }
+
+  private record BoundRecorder(EventRecorder delegate, Context<?> context)
+      implements ResourceEventRecorder {
+
+    @Override
+    public void normal(String reason, String message) {
+      record(EventRecord.normal(reason, message));
+    }
+
+    @Override
+    public void warn(String reason, String message) {
+      record(EventRecord.warning(reason, message));
+    }
+
+    @Override
+    public void record(EventRecord event) {
+      delegate.record(event, context);
+    }
+  }
+}
diff --git a/spark-operator/src/main/java/org/apache/spark/k8s/operator/utils/EventUtils.java b/spark-operator/src/main/java/org/apache/spark/k8s/operator/utils/EventUtils.java
new file mode 100644
index 00000000..346cd0a0
--- /dev/null
+++ b/spark-operator/src/main/java/org/apache/spark/k8s/operator/utils/EventUtils.java
@@ -0,0 +1,145 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.spark.k8s.operator.utils;
+
+import io.javaoperatorsdk.operator.api.event.EventRecord;
+import io.javaoperatorsdk.operator.api.event.EventType;
+import io.javaoperatorsdk.operator.api.event.ResourceEventRecorder;
+
+/**
+ * Utility class for publishing Kubernetes events about Spark resources.
+ *
+ * <p>Whether events are published at all is decided by {@link ConfigurableEventRecorder}, which is
+ * registered for the whole operator, so callers here do not read the config themselves. Writing an
+ * event is best effort: {@link
+ * io.javaoperatorsdk.operator.api.event.DefaultEventRecorder#record(EventRecord,
+ * io.javaoperatorsdk.operator.api.reconciler.Context)} logs and swallows write failures rather than
+ * failing the reconciliation.
+ */
+public final class EventUtils {
+
+  /** Reason for an event describing an unhandled error thrown out of a reconciliation. */
+  public static final String REASON_RECONCILE_ERROR = "ReconcileError";
+
+  /** Reason for an event describing a failure to persist the resource status. */
+  public static final String REASON_STATUS_UPDATE_FAILED = "StatusUpdateFailed";
+
+  /** Reason for an event describing an unhandled error thrown out of a cleanup. */
+  public static final String REASON_CLEANUP_ERROR = "CleanupError";
+
+  /** Maximum number of characters an event message may have, including the ellipsis. */
+  static final int MAX_MESSAGE_LENGTH = 1024;
+
+  /** Appended in place of the characters dropped from an over-long message. */
+  private static final String ELLIPSIS = "...";
+
+  /** Maximum number of links followed when looking for the innermost cause of a failure. */
+  private static final int MAX_CAUSE_DEPTH = 10;
+
+  private EventUtils() {}
+
+  /**
+   * Publishes a warning event about a Spark resource.
+   *
+   * <p>The reason doubles as the event key, so repeated warnings for the same reason on the same
+   * resource collapse into a count increment on a single Event object instead of creating one
+   * Event per occurrence. Messages therefore must not be part of the identity: they typically vary
+   * between attempts, for instance because a {@code KubernetesClientException} message embeds the
+   * request URL.
+   *
+   * @param recorder The event recorder bound to the resource.
+   * @param reason A short CamelCase reason, as expected by Kubernetes.
+   * @param message The message, truncated to {@value #MAX_MESSAGE_LENGTH} characters.
+   */
+  public static void warn(ResourceEventRecorder recorder, String reason, String message) {
+    recorder.record(
+        EventRecord.builder()
+            .type(EventType.WARNING)
+            .reason(reason)
+            .message(truncate(message))
+            .key(reason)
+            .build());
+  }
+
+  /**
+   * Builds a concise single-line description of an exception, suitable for an event message. The
+   * innermost cause is appended when the exception has one, since that is usually where the
+   * actionable detail is. The full stack trace is intentionally omitted, it belongs in the
+   * operator log.
+   *
+   * @param throwable The exception to describe, may be null.
+   * @return A description of the exception.
+   */
+  public static String describe(Throwable throwable) {
+    if (throwable == null) {
+      return "";
+    }
+    StringBuilder builder = new StringBuilder(describeSingle(throwable));
+    Throwable rootCause = rootCauseOf(throwable);
+    if (rootCause != null) {
+      builder.append(", caused by: ").append(describeSingle(rootCause));
+    }
+    return builder.toString();
+  }
+
+  private static String describeSingle(Throwable throwable) {
+    String message = throwable.getMessage();
+    String type = throwable.getClass().getSimpleName();
+    return StringUtils.isBlank(message) ? type : type + ": " + message;
+  }
+
+  /**
+   * Returns the innermost cause of the given throwable, or null when it has none.
+   *
+   * @param throwable The exception to walk, must not be null.
+   * @return The innermost cause found within the depth bound, or null if there is no cause.
+   */
+  private static Throwable rootCauseOf(Throwable throwable) {
+    Throwable rootCause = throwable.getCause();
+    if (rootCause == null) {
+      return null;
+    }
+    // Bounded walk: a cyclic cause chain must not hang the reconciler. Throwable#getCause returns
+    // null for a self referencing link, so only a longer cycle can come back around. Throwable
+    // does not override equals, so this compares identity.
+    for (int depth = 1; depth < MAX_CAUSE_DEPTH; depth++) {
+      Throwable next = rootCause.getCause();
+      if (next == null || next.equals(throwable)) {
+        break;
+      }
+      rootCause = next;
+    }
+    return rootCause;
+  }
+
+  /**
+   * Shortens a message to at most {@value #MAX_MESSAGE_LENGTH} characters, marking a shortened
+   * message with a trailing ellipsis.
+   *
+   * @param message The message to shorten, must not be null.
+   * @return The message, at most {@value #MAX_MESSAGE_LENGTH} characters long.
+   */
+  static String truncate(String message) {
+    if (message.length() <= MAX_MESSAGE_LENGTH) {
+      return message;
+    }
+    return message.substring(0, MAX_MESSAGE_LENGTH - ELLIPSIS.length()) + ELLIPSIS;
+  }
+}
diff --git a/spark-operator/src/main/java/org/apache/spark/k8s/operator/utils/ReconcilerUtils.java b/spark-operator/src/main/java/org/apache/spark/k8s/operator/utils/ReconcilerUtils.java
index 00c578a8..84802825 100644
--- a/spark-operator/src/main/java/org/apache/spark/k8s/operator/utils/ReconcilerUtils.java
+++ b/spark-operator/src/main/java/org/apache/spark/k8s/operator/utils/ReconcilerUtils.java
@@ -43,7 +43,9 @@ import io.fabric8.kubernetes.api.model.ObjectMeta;
 import io.fabric8.kubernetes.api.model.ObjectMetaBuilder;
 import io.fabric8.kubernetes.client.KubernetesClient;
 import io.fabric8.kubernetes.client.KubernetesClientException;
+import io.javaoperatorsdk.operator.api.reconciler.Context;
 import io.javaoperatorsdk.operator.api.reconciler.DeleteControl;
+import io.javaoperatorsdk.operator.api.reconciler.RetryInfo;
 import io.javaoperatorsdk.operator.api.reconciler.UpdateControl;
 import lombok.extern.slf4j.Slf4j;
 
@@ -238,7 +240,25 @@ public final class ReconcilerUtils {
     };
   }
 
-  private static boolean isTransientError(KubernetesClientException e) {
+  /**
+   * Whether the given reconciliation is the first attempt at the resource rather than a retry.
+   * {@link RetryInfo#getAttemptCount()} is 0 for an execution that is not a retry, and the info is
+   * absent altogether when retries are not configured.
+   *
+   * @param context The reconciliation context.
+   * @return True if this execution is not a retry, false otherwise.
+   */
+  public static boolean isFirstAttempt(Context<?> context) {
+    return context.getRetryInfo().map(RetryInfo::getAttemptCount).orElse(0) == 0;
+  }
+
+  /**
+   * Whether the given failure is transport level rather than a decision by the API server.
+   *
+   * @param e The failure to classify.
+   * @return True if the request did not reach a healthy API server, false otherwise.
+   */
+  static boolean isTransientError(KubernetesClientException e) {
     // code 0 is fabric8's sentinel for network-level failures (timeouts, connection resets, etc.)
     return switch (e.getCode()) {
       case 0, HTTP_CLIENT_TIMEOUT, HTTP_BAD_GATEWAY,
diff --git a/spark-operator/src/main/java/org/apache/spark/k8s/operator/utils/StatusRecorder.java b/spark-operator/src/main/java/org/apache/spark/k8s/operator/utils/StatusRecorder.java
index 9afb745b..e726436c 100644
--- a/spark-operator/src/main/java/org/apache/spark/k8s/operator/utils/StatusRecorder.java
+++ b/spark-operator/src/main/java/org/apache/spark/k8s/operator/utils/StatusRecorder.java
@@ -37,6 +37,8 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.spark.k8s.operator.BaseResource;
 import org.apache.spark.k8s.operator.context.BaseContext;
 import org.apache.spark.k8s.operator.listeners.BaseStatusListener;
+import org.apache.spark.k8s.operator.status.BaseState;
+import org.apache.spark.k8s.operator.status.BaseStateSummary;
 import org.apache.spark.k8s.operator.status.BaseStatus;
 
 /**
@@ -79,10 +81,11 @@ public class StatusRecorder<
    * underlying resource spec was update in the meantime. This is necessary for the correct operator
    * behavior.
    *
-   * @param resource Resource for which status update should be performed.
-   * @param client KubernetesClient instance.
+   * @param context Context of the resource for which status update should be performed.
    */
-  private void patchAndStatusWithVersionLocked(CR resource, KubernetesClient client) {
+  private void patchAndStatusWithVersionLocked(BaseContext<CR> context) {
+    CR resource = context.getResource();
+    KubernetesClient client = context.getClient();
     ObjectNode newStatusNode = objectMapper.convertValue(resource.getStatus(), ObjectNode.class);
     ResourceID resourceId = ResourceID.fromResource(resource);
     ObjectNode previousStatusNode = statusCache.get(resourceId);
@@ -134,6 +137,36 @@ public class StatusRecorder<
         listener -> {
           listener.listenStatus(resource, prevStatus, resource.getStatus());
         });
+    recordFailureEvent(context, resource.getStatus());
+  }
+
+  /**
+   * Publishes a warning event when the resource has just moved into a failure state.
+   *
+   * <p>This is the seam where the failures users actually hit surface: every reconcile step turns
+   * a rejected submission, a failed validation or an expired timeout into a state rather than
+   * throwing, so the reconciler error hooks never see them. Reaching this point means the patch
+   * succeeded and the status genuinely changed, so an event here fires once per transition.
+   *
+   * <p>The state name is used as both reason and dedup key, so an app that keeps re-entering the
+   * same failure state bumps the count on one Event instead of accumulating one per attempt.
+   *
+   * @param context Context of the resource whose status has just been patched.
+   * @param status The status that was persisted.
+   */
+  private void recordFailureEvent(BaseContext<CR> context, STATUS status) {
+    BaseState<?> currentState = status.getCurrentState();
+    if (currentState == null) {
+      return;
+    }
+    if (currentState.getCurrentStateSummary() instanceof BaseStateSummary summary
+        && summary.isFailure()) {
+      String message = currentState.getMessage();
+      EventUtils.warn(
+          context.getEventRecorder(),
+          summary.name(),
+          StringUtils.isBlank(message) ? summary.name() : message);
+    }
   }
 
   /**
@@ -146,10 +179,16 @@ public class StatusRecorder<
   public boolean persistStatus(BaseContext<CR> context, STATUS newStatus) {
     try {
       context.getResource().setStatus(newStatus);
-      patchAndStatusWithVersionLocked(context.getResource(), context.getClient());
+      patchAndStatusWithVersionLocked(context);
       return true;
     } catch (KubernetesClientException e) {
       log.error("Error while persisting status to {}", newStatus, e);
+      if (!ReconcilerUtils.isTransientError(e)) {
+        EventUtils.warn(
+            context.getEventRecorder(),
+            EventUtils.REASON_STATUS_UPDATE_FAILED,
+            "Failed to update status, the reported status may be stale. " + EventUtils.describe(e));
+      }
       return false;
     }
   }
diff --git a/spark-operator/src/test/java/org/apache/spark/k8s/operator/reconciler/SparkAppReconcilerTest.java b/spark-operator/src/test/java/org/apache/spark/k8s/operator/reconciler/SparkAppReconcilerTest.java
index 51641010..ef935842 100644
--- a/spark-operator/src/test/java/org/apache/spark/k8s/operator/reconciler/SparkAppReconcilerTest.java
+++ b/spark-operator/src/test/java/org/apache/spark/k8s/operator/reconciler/SparkAppReconcilerTest.java
@@ -26,6 +26,8 @@ import static org.apache.spark.k8s.operator.config.SparkOperatorConf.API_SECONDA
 import static org.apache.spark.k8s.operator.config.SparkOperatorConf.API_SECONDARY_RESOURCE_CREATE_MAX_ATTEMPTS;
 import static org.apache.spark.k8s.operator.config.SparkOperatorConf.API_SECONDARY_RESOURCE_CREATE_MAX_BACKOFF_MILLIS;
 import static org.apache.spark.k8s.operator.utils.TestUtils.setConfigKey;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -34,6 +36,7 @@ import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.mockConstruction;
+import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
@@ -46,10 +49,15 @@ import io.fabric8.kubernetes.api.model.PodBuilder;
 import io.fabric8.kubernetes.client.KubernetesClient;
 import io.fabric8.kubernetes.client.KubernetesClientException;
 import io.fabric8.kubernetes.client.dsl.NamespaceableResource;
+import io.javaoperatorsdk.operator.api.event.EventRecord;
+import io.javaoperatorsdk.operator.api.event.EventType;
+import io.javaoperatorsdk.operator.api.event.ResourceEventRecorder;
 import io.javaoperatorsdk.operator.api.reconciler.Context;
 import io.javaoperatorsdk.operator.api.reconciler.DeleteControl;
+import io.javaoperatorsdk.operator.api.reconciler.RetryInfo;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
+import org.mockito.ArgumentCaptor;
 import org.mockito.MockedConstruction;
 import org.mockito.MockedStatic;
 import org.mockito.Mockito;
@@ -61,6 +69,7 @@ import org.apache.spark.k8s.operator.metrics.healthcheck.SentinelManager;
 import org.apache.spark.k8s.operator.status.ApplicationState;
 import org.apache.spark.k8s.operator.status.ApplicationStateSummary;
 import org.apache.spark.k8s.operator.status.ApplicationStatus;
+import org.apache.spark.k8s.operator.utils.EventUtils;
 import org.apache.spark.k8s.operator.utils.ReconcilerUtils;
 import org.apache.spark.k8s.operator.utils.SparkAppStatusRecorder;
 
@@ -69,6 +78,7 @@ class SparkAppReconcilerTest {
   private final SentinelManager<SparkApplication> mockSentinelManager = mock(SentinelManager.class);
   private final KubernetesClient mockClient = mock(KubernetesClient.class);
   private final Context<SparkApplication> mockContext = mock(Context.class);
+  private final ResourceEventRecorder mockEventRecorder = mock(ResourceEventRecorder.class);
   private final Pod mockDriver = mock(Pod.class);
   private final SparkAppSubmissionWorker mockWorker = mock(SparkAppSubmissionWorker.class);
   SparkApplication app = new SparkApplication();
@@ -258,4 +268,61 @@ class SparkAppReconcilerTest {
                     savedMultiplier);
         }
     }
+
+  @Test
+  void updateErrorStatusWarnsWithReconcileError() {
+    when(mockContext.eventRecorder()).thenReturn(mockEventRecorder);
+    var failure =
+        new RuntimeException("request failed", new IllegalStateException("bad config"));
+
+    var control = reconciler.updateErrorStatus(app, mockContext, failure);
+
+    assertThat(control.getResource()).isEmpty();
+    var event = captureRecordedEvent();
+    assertThat(event.type()).isEqualTo(EventType.WARNING);
+    assertThat(event.reason()).isEqualTo(EventUtils.REASON_RECONCILE_ERROR);
+    // The full prefix, so a kind copy-paste from the cluster reconciler would fail here.
+    assertThat(event.message())
+        .startsWith("Spark App Reconciliation failed.")
+        .contains("RuntimeException: request failed")
+        .contains("caused by: IllegalStateException: bad config");
+  }
+
+  @Test
+  void updateErrorStatusPublishesOnlyOnTheFirstAttempt() {
+    when(mockContext.eventRecorder()).thenReturn(mockEventRecorder);
+    var retryInfo = mock(RetryInfo.class);
+    when(retryInfo.getAttemptCount()).thenReturn(1);
+    when(mockContext.getRetryInfo()).thenReturn(Optional.of(retryInfo));
+
+    reconciler.updateErrorStatus(app, mockContext, new RuntimeException("boom"));
+
+    // JOSDK calls this on every retry attempt, each emit is a blocking write against an API
+    // server that is often the cause of the failure.
+    verify(mockEventRecorder, never()).record(any(EventRecord.class));
+  }
+
+  @Test
+  void cleanupFailureWarnsWithCleanupError() {
+    when(mockContext.eventRecorder()).thenReturn(mockEventRecorder);
+    var failure = new IllegalStateException("cannot build spec");
+    try (MockedConstruction<SparkAppContext> ignored =
+        mockConstruction(
+            SparkAppContext.class, (mock, ctx) -> when(mock.getResource()).thenThrow(failure))) {
+
+      assertThatThrownBy(() -> reconciler.cleanup(app, mockContext)).isSameAs(failure);
+    }
+
+    var event = captureRecordedEvent();
+    assertThat(event.reason()).isEqualTo(EventUtils.REASON_CLEANUP_ERROR);
+    assertThat(event.message())
+        .startsWith("Spark App Cleanup failed, the resource cannot finish deleting.")
+        .contains("IllegalStateException: cannot build spec");
+  }
+
+  private EventRecord captureRecordedEvent() {
+    ArgumentCaptor<EventRecord> captor = ArgumentCaptor.forClass(EventRecord.class);
+    verify(mockEventRecorder, times(1)).record(captor.capture());
+    return captor.getValue();
+  }
 }
diff --git a/spark-operator/src/test/java/org/apache/spark/k8s/operator/reconciler/SparkClusterReconcilerTest.java b/spark-operator/src/test/java/org/apache/spark/k8s/operator/reconciler/SparkClusterReconcilerTest.java
index 011bb0e0..f023ba07 100644
--- a/spark-operator/src/test/java/org/apache/spark/k8s/operator/reconciler/SparkClusterReconcilerTest.java
+++ b/spark-operator/src/test/java/org/apache/spark/k8s/operator/reconciler/SparkClusterReconcilerTest.java
@@ -19,6 +19,8 @@
 
 package org.apache.spark.k8s.operator.reconciler;
 
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.mockito.ArgumentMatchers.any;
@@ -26,15 +28,24 @@ import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.mockConstruction;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
 import java.util.List;
+import java.util.Optional;
 
 import io.fabric8.kubernetes.client.KubernetesClient;
+import io.javaoperatorsdk.operator.api.event.EventRecord;
+import io.javaoperatorsdk.operator.api.event.EventType;
+import io.javaoperatorsdk.operator.api.event.ResourceEventRecorder;
 import io.javaoperatorsdk.operator.api.reconciler.Context;
 import io.javaoperatorsdk.operator.api.reconciler.DeleteControl;
+import io.javaoperatorsdk.operator.api.reconciler.RetryInfo;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
+import org.mockito.ArgumentCaptor;
 import org.mockito.MockedConstruction;
 
 import org.apache.spark.k8s.operator.SparkCluster;
@@ -45,6 +56,7 @@ import org.apache.spark.k8s.operator.reconciler.reconcilesteps.ClusterReconcileS
 import org.apache.spark.k8s.operator.status.ClusterState;
 import org.apache.spark.k8s.operator.status.ClusterStateSummary;
 import org.apache.spark.k8s.operator.status.ClusterStatus;
+import org.apache.spark.k8s.operator.utils.EventUtils;
 import org.apache.spark.k8s.operator.utils.SparkClusterStatusRecorder;
 
 class SparkClusterReconcilerTest {
@@ -52,6 +64,7 @@ class SparkClusterReconcilerTest {
   private final SentinelManager<SparkCluster> mockSentinelManager = mock(SentinelManager.class);
   private final KubernetesClient mockClient = mock(KubernetesClient.class);
   private final Context<SparkCluster> mockContext = mock(Context.class);
+  private final ResourceEventRecorder mockEventRecorder = mock(ResourceEventRecorder.class);
   private final SparkClusterSubmissionWorker mockWorker = mock(SparkClusterSubmissionWorker.class);
   SparkCluster cluster = new SparkCluster();
   SparkClusterReconciler reconciler =
@@ -192,4 +205,59 @@ class SparkClusterReconcilerTest {
     assertEquals(
         "ClusterUnknownStateStep", steps.get(2).getClass().getSimpleName());
   }
+
+  @Test
+  void updateErrorStatusWarnsWithReconcileError() {
+    when(mockContext.eventRecorder()).thenReturn(mockEventRecorder);
+    var failure = new RuntimeException("request failed", new IllegalStateException("bad config"));
+
+    var control = reconciler.updateErrorStatus(cluster, mockContext, failure);
+
+    assertThat(control.getResource()).isEmpty();
+    var event = captureRecordedEvent();
+    assertThat(event.type()).isEqualTo(EventType.WARNING);
+    assertThat(event.reason()).isEqualTo(EventUtils.REASON_RECONCILE_ERROR);
+    // The full prefix, so a kind copy-paste from the app reconciler would fail here.
+    assertThat(event.message())
+        .startsWith("Spark Cluster Reconciliation failed.")
+        .contains("RuntimeException: request failed")
+        .contains("caused by: IllegalStateException: bad config");
+  }
+
+  @Test
+  void updateErrorStatusPublishesOnlyOnTheFirstAttempt() {
+    when(mockContext.eventRecorder()).thenReturn(mockEventRecorder);
+    var retryInfo = mock(RetryInfo.class);
+    when(retryInfo.getAttemptCount()).thenReturn(1);
+    when(mockContext.getRetryInfo()).thenReturn(Optional.of(retryInfo));
+
+    reconciler.updateErrorStatus(cluster, mockContext, new RuntimeException("boom"));
+
+    verify(mockEventRecorder, never()).record(any(EventRecord.class));
+  }
+
+  @Test
+  void cleanupFailureWarnsWithCleanupError() {
+    when(mockContext.eventRecorder()).thenReturn(mockEventRecorder);
+    var failure = new IllegalStateException("cannot build spec");
+    try (MockedConstruction<SparkClusterContext> ignored =
+        mockConstruction(
+            SparkClusterContext.class,
+            (mock, ctx) -> when(mock.getResource()).thenThrow(failure))) {
+
+      assertThatThrownBy(() -> reconciler.cleanup(cluster, mockContext)).isSameAs(failure);
+    }
+
+    var event = captureRecordedEvent();
+    assertThat(event.reason()).isEqualTo(EventUtils.REASON_CLEANUP_ERROR);
+    assertThat(event.message())
+        .startsWith("Spark Cluster Cleanup failed, the resource cannot finish deleting.")
+        .contains("IllegalStateException: cannot build spec");
+  }
+
+  private EventRecord captureRecordedEvent() {
+    ArgumentCaptor<EventRecord> captor = ArgumentCaptor.forClass(EventRecord.class);
+    verify(mockEventRecorder, times(1)).record(captor.capture());
+    return captor.getValue();
+  }
 }
diff --git a/spark-operator/src/test/java/org/apache/spark/k8s/operator/utils/ConfigurableEventRecorderTest.java b/spark-operator/src/test/java/org/apache/spark/k8s/operator/utils/ConfigurableEventRecorderTest.java
new file mode 100644
index 00000000..2900d868
--- /dev/null
+++ b/spark-operator/src/test/java/org/apache/spark/k8s/operator/utils/ConfigurableEventRecorderTest.java
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.spark.k8s.operator.utils;
+
+import static org.apache.spark.k8s.operator.config.SparkOperatorConf.KUBERNETES_EVENTS_ENABLED;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoInteractions;
+
+import java.util.Map;
+
+import io.javaoperatorsdk.operator.api.event.EventRecord;
+import io.javaoperatorsdk.operator.api.event.EventRecorder;
+import io.javaoperatorsdk.operator.api.event.EventType;
+import io.javaoperatorsdk.operator.api.reconciler.Context;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Test;
+import org.mockito.ArgumentCaptor;
+
+import org.apache.spark.k8s.operator.config.SparkOperatorConfManager;
+
+class ConfigurableEventRecorderTest {
+
+  private final EventRecorder delegate = mock(EventRecorder.class);
+  private final Context<?> context = mock(Context.class);
+  private final ConfigurableEventRecorder recorder = new ConfigurableEventRecorder(delegate);
+
+  private void setEventsEnabled(boolean enabled) {
+    SparkOperatorConfManager.INSTANCE.refresh(
+        Map.of(KUBERNETES_EVENTS_ENABLED.getKey(), String.valueOf(enabled)));
+  }
+
+  @AfterEach
+  void resetConf() {
+    SparkOperatorConfManager.INSTANCE.refresh(Map.of());
+  }
+
+  @Test
+  void dropsEventsWhileDisabled() {
+    // The option defaults to false, so an operator that never opts in writes nothing.
+    recorder.record(EventRecord.warning("ReconcileError", "boom"), context);
+
+    verifyNoInteractions(delegate);
+  }
+
+  @Test
+  void forwardsEventsWhileEnabled() {
+    setEventsEnabled(true);
+    EventRecord event = EventRecord.warning("ReconcileError", "boom");
+
+    recorder.record(event, context);
+
+    verify(delegate).record(event, context);
+  }
+
+  @Test
+  void boundRecorderIsGatedOnTheFlagRatherThanOnBindingTime() {
+    // Bound while disabled, then enabled mid reconciliation: the dynamic override has to take
+    // effect, which it only does if the flag is read per event and not when forContext is called.
+    var bound = recorder.forContext(context);
+    bound.warn("ReconcileError", "dropped");
+    verifyNoInteractions(delegate);
+
+    setEventsEnabled(true);
+    bound.warn("ReconcileError", "published");
+
+    ArgumentCaptor<EventRecord> captor = ArgumentCaptor.forClass(EventRecord.class);
+    verify(delegate).record(captor.capture(), eq(context));
+    assertThat(captor.getValue().message()).isEqualTo("published");
+  }
+
+  @Test
+  void boundRecorderPassesThroughTypeAndReason() {
+    setEventsEnabled(true);
+    var bound = recorder.forContext(context);
+
+    bound.normal("DriverRequested", "requested");
+
+    ArgumentCaptor<EventRecord> captor = ArgumentCaptor.forClass(EventRecord.class);
+    verify(delegate).record(captor.capture(), eq(context));
+    assertThat(captor.getValue().type()).isEqualTo(EventType.NORMAL);
+    assertThat(captor.getValue().reason()).isEqualTo("DriverRequested");
+  }
+
+  @Test
+  void treatsAMalformedOverrideAsDisabled() {
+    // The option is a boxed Boolean, so a malformed override can resolve to null. Publishing an
+    // event must never be the thing that throws out of a reconciliation.
+    SparkOperatorConfManager.INSTANCE.refresh(
+        Map.of(KUBERNETES_EVENTS_ENABLED.getKey(), "null"));
+
+    recorder.record(EventRecord.warning("ReconcileError", "boom"), context);
+
+    verifyNoInteractions(delegate);
+  }
+}
diff --git a/spark-operator/src/test/java/org/apache/spark/k8s/operator/utils/EventUtilsTest.java b/spark-operator/src/test/java/org/apache/spark/k8s/operator/utils/EventUtilsTest.java
new file mode 100644
index 00000000..4c17218a
--- /dev/null
+++ b/spark-operator/src/test/java/org/apache/spark/k8s/operator/utils/EventUtilsTest.java
@@ -0,0 +1,137 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.spark.k8s.operator.utils;
+
+import static org.apache.spark.k8s.operator.utils.EventUtils.MAX_MESSAGE_LENGTH;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+
+import io.javaoperatorsdk.operator.api.event.EventRecord;
+import io.javaoperatorsdk.operator.api.event.EventType;
+import io.javaoperatorsdk.operator.api.event.ResourceEventRecorder;
+import org.junit.jupiter.api.Test;
+import org.mockito.ArgumentCaptor;
+
+class EventUtilsTest {
+
+  private final ResourceEventRecorder recorder = mock(ResourceEventRecorder.class);
+
+  private EventRecord recordWarning(String reason, String message) {
+    EventUtils.warn(recorder, reason, message);
+    ArgumentCaptor<EventRecord> captor = ArgumentCaptor.forClass(EventRecord.class);
+    verify(recorder).record(captor.capture());
+    return captor.getValue();
+  }
+
+  @Test
+  void warnPublishesWarningWithReasonAndMessage() {
+    EventRecord event = recordWarning(EventUtils.REASON_RECONCILE_ERROR, "driver pod rejected");
+
+    assertThat(event.type()).isEqualTo(EventType.WARNING);
+    assertThat(event.reason()).isEqualTo(EventUtils.REASON_RECONCILE_ERROR);
+    assertThat(event.message()).isEqualTo("driver pod rejected");
+  }
+
+  @Test
+  void warnKeysTheEventOnReasonSoRepeatsAggregate() {
+    // The key, not the message, is what DefaultEventRecorder digests into the Event name. Keying
+    // on the reason is what makes a repeated failure bump the count on one Event instead of
+    // creating a new one every time the message varies.
+    EventRecord event = recordWarning(EventUtils.REASON_STATUS_UPDATE_FAILED, "attempt 3 of 15");
+
+    assertThat(event.key()).contains(EventUtils.REASON_STATUS_UPDATE_FAILED);
+  }
+
+  @Test
+  void warnTruncatesAnOverLongMessage() {
+    EventRecord event = recordWarning(EventUtils.REASON_CLEANUP_ERROR, "x".repeat(5000));
+
+    assertThat(event.message()).hasSize(MAX_MESSAGE_LENGTH).endsWith("...");
+  }
+
+  @Test
+  void truncateKeepsMessagesWithinTheLimitUntouched() {
+    String atLimit = "y".repeat(MAX_MESSAGE_LENGTH);
+
+    assertThat(EventUtils.truncate("short")).isEqualTo("short");
+    assertThat(EventUtils.truncate(atLimit)).isEqualTo(atLimit);
+  }
+
+  @Test
+  void truncateCapsTotalLengthIncludingTheEllipsis() {
+    // The ellipsis replaces the dropped characters rather than being appended past the limit, so
+    // the result never exceeds what the caller was promised.
+    String truncated = EventUtils.truncate("z".repeat(MAX_MESSAGE_LENGTH + 1));
+
+    assertThat(truncated).hasSize(MAX_MESSAGE_LENGTH);
+    assertThat(truncated).isEqualTo("z".repeat(MAX_MESSAGE_LENGTH - 3) + "...");
+  }
+
+  @Test
+  void describeAppendsInnermostCause() {
+    Throwable root = new IllegalArgumentException("quota exceeded");
+    Throwable middle = new IllegalStateException("submission rejected", root);
+    Throwable top = new RuntimeException("reconcile failed", middle);
+
+    // The middle link is dropped, the innermost cause carries the actionable detail.
+    assertThat(EventUtils.describe(top))
+        .isEqualTo(
+            "RuntimeException: reconcile failed, caused by: "
+                + "IllegalArgumentException: quota exceeded");
+  }
+
+  @Test
+  void describeHandlesNullAndCauseless() {
+    assertThat(EventUtils.describe(null)).isEmpty();
+    assertThat(EventUtils.describe(new IllegalStateException("no cause")))
+        .isEqualTo("IllegalStateException: no cause");
+  }
+
+  @Test
+  void describeFallsBackToTypeWhenMessageIsBlank() {
+    assertThat(EventUtils.describe(new IllegalStateException())).isEqualTo("IllegalStateException");
+  }
+
+  @Test
+  void describeStopsAtMaxCauseDepth() {
+    // 15 links, deeper than the 10 the walk is allowed to follow.
+    Throwable cause = new IllegalStateException("cause-15");
+    for (int i = 14; i >= 1; i--) {
+      cause = new IllegalStateException("cause-" + i, cause);
+    }
+    Throwable top = new RuntimeException("top", cause);
+
+    // The walk reports the deepest link it reached rather than giving up entirely.
+    assertThat(EventUtils.describe(top))
+        .isEqualTo("RuntimeException: top, caused by: IllegalStateException: cause-10");
+  }
+
+  @Test
+  void describeTerminatesOnCyclicCauseChain() {
+    Throwable first = new RuntimeException("first");
+    Throwable second = new IllegalStateException("second", first);
+    // first -> second -> first, a chain a naive walk would follow forever.
+    first.initCause(second);
+
+    assertThat(EventUtils.describe(first))
+        .isEqualTo("RuntimeException: first, caused by: IllegalStateException: second");
+  }
+}
diff --git a/spark-operator/src/test/java/org/apache/spark/k8s/operator/utils/StatusRecorderTest.java b/spark-operator/src/test/java/org/apache/spark/k8s/operator/utils/StatusRecorderTest.java
index aa8039e1..d0b326b6 100644
--- a/spark-operator/src/test/java/org/apache/spark/k8s/operator/utils/StatusRecorderTest.java
+++ b/spark-operator/src/test/java/org/apache/spark/k8s/operator/utils/StatusRecorderTest.java
@@ -25,6 +25,7 @@ import static org.mockito.ArgumentMatchers.assertArg;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoInteractions;
 import static org.mockito.Mockito.when;
 
 import java.util.List;
@@ -33,11 +34,17 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import io.fabric8.kubernetes.client.KubernetesClient;
 import io.fabric8.kubernetes.client.server.mock.EnableKubernetesMockClient;
 import io.fabric8.kubernetes.client.server.mock.KubernetesMockServer;
+import io.javaoperatorsdk.operator.api.event.EventRecord;
+import io.javaoperatorsdk.operator.api.event.EventType;
+import io.javaoperatorsdk.operator.api.event.ResourceEventRecorder;
 import org.junit.jupiter.api.Test;
+import org.mockito.ArgumentCaptor;
 
 import org.apache.spark.k8s.operator.SparkApplication;
 import org.apache.spark.k8s.operator.context.BaseContext;
 import org.apache.spark.k8s.operator.listeners.SparkAppStatusListener;
+import org.apache.spark.k8s.operator.status.ApplicationState;
+import org.apache.spark.k8s.operator.status.ApplicationStateSummary;
 import org.apache.spark.k8s.operator.status.ApplicationStatus;
 
 @EnableKubernetesMockClient
@@ -52,6 +59,8 @@ class StatusRecorderTest {
 
   SparkAppStatusListener mockStatusListener = mock(SparkAppStatusListener.class);
 
+  ResourceEventRecorder mockEventRecorder = mock(ResourceEventRecorder.class);
+
   StatusRecorder<ApplicationStatus, SparkApplication, SparkAppStatusListener> statusRecorder =
       new StatusRecorder<>(
           List.of(mockStatusListener), ApplicationStatus.class, SparkApplication.class);
@@ -116,6 +125,115 @@ class StatusRecorderTest {
             any());
   }
 
+  @Test
+  void publishesAnEventWhenTheResourceEntersAFailureState() {
+    var testResource = getSparkApplication("1");
+    var context = contextFor(testResource);
+    expectStatusPatch(testResource, getSparkApplication("2"));
+
+    // The failure users actually hit: AppInitStep catches the rejected driver pod and records
+    // SchedulingFailure rather than throwing, so no reconciler error hook ever sees it.
+    statusRecorder.persistStatus(
+        context,
+        new ApplicationStatus()
+            .appendNewState(
+                new ApplicationState(
+                    ApplicationStateSummary.SchedulingFailure, "exceeded quota for pods")));
+
+    var event = captureRecordedEvent();
+    assertThat(event.type()).isEqualTo(EventType.WARNING);
+    assertThat(event.reason()).isEqualTo(ApplicationStateSummary.SchedulingFailure.name());
+    assertThat(event.message()).isEqualTo("exceeded quota for pods");
+    // Keyed on the state so an app that keeps re-entering it aggregates onto one Event.
+    assertThat(event.key()).contains(ApplicationStateSummary.SchedulingFailure.name());
+  }
+
+  @Test
+  void publishesNoEventForANonFailureTransition() {
+    var testResource = getSparkApplication("1");
+    var context = contextFor(testResource);
+    expectStatusPatch(testResource, getSparkApplication("2"));
+
+    statusRecorder.persistStatus(
+        context,
+        new ApplicationStatus()
+            .appendNewState(
+                new ApplicationState(ApplicationStateSummary.DriverRequested, "driver requested")));
+
+    // Only failures are published, a Normal event per transition would be pure noise.
+    verifyNoInteractions(mockEventRecorder);
+  }
+
+  @Test
+  void publishesNoEventWhenTheStatusDidNotChange() {
+    var testResource = getSparkApplication("1");
+    var context = contextFor(testResource);
+    var failed =
+        new ApplicationStatus()
+            .appendNewState(new ApplicationState(ApplicationStateSummary.Failed, "driver failed"));
+    expectStatusPatch(testResource, getSparkApplication("2"));
+
+    statusRecorder.persistStatus(context, failed);
+    // Second call with the very same status: patchAndStatusWithVersionLocked short circuits, so
+    // the resource has not transitioned again and must not be reported again.
+    statusRecorder.persistStatus(context, failed);
+
+    verify(mockEventRecorder, times(1)).record(any(EventRecord.class));
+  }
+
+  @Test
+  void publishesAnEventWhenTheStatusPatchIsRejected() {
+    var testResource = getSparkApplication("1");
+    var context = contextFor(testResource);
+    // 403 is a decision by a reachable API server, so reporting it costs a healthy request.
+    server.expect().withPath(statusPathOf(testResource)).andReturn(403, null).always();
+
+    assertThat(statusRecorder.persistStatus(context, new ApplicationStatus())).isFalse();
+
+    var event = captureRecordedEvent();
+    assertThat(event.reason()).isEqualTo(EventUtils.REASON_STATUS_UPDATE_FAILED);
+    assertThat(event.message()).contains("the reported status may be stale");
+  }
+
+  @Test
+  void publishesNoEventWhenTheApiServerIsUnreachable() {
+    var testResource = getSparkApplication("1");
+    var context = contextFor(testResource);
+    // 503 means the control plane is already degraded. Writing an event costs two more requests
+    // against it, so the observability path must not pile on.
+    server.expect().withPath(statusPathOf(testResource)).andReturn(503, null).always();
+
+    assertThat(statusRecorder.persistStatus(context, new ApplicationStatus())).isFalse();
+
+    verifyNoInteractions(mockEventRecorder);
+  }
+
+  private BaseContext<SparkApplication> contextFor(SparkApplication resource) {
+    BaseContext<SparkApplication> context = mock(BaseContext.class);
+    when(context.getResource()).thenReturn(resource);
+    when(context.getClient()).thenReturn(client);
+    when(context.getEventRecorder()).thenReturn(mockEventRecorder);
+    return context;
+  }
+
+  private void expectStatusPatch(SparkApplication resource, SparkApplication updated) {
+    server.expect().withPath(statusPathOf(resource)).andReturn(200, updated).always();
+  }
+
+  private static String statusPathOf(SparkApplication resource) {
+    return "/apis/spark.apache.org/v1/namespaces/"
+        + DEFAULT_NS
+        + "/sparkapplications/"
+        + resource.getMetadata().getName()
+        + "/status";
+  }
+
+  private EventRecord captureRecordedEvent() {
+    ArgumentCaptor<EventRecord> captor = ArgumentCaptor.forClass(EventRecord.class);
+    verify(mockEventRecorder).record(captor.capture());
+    return captor.getValue();
+  }
+
   private static SparkApplication getSparkApplication(String resourceVersion) {
     var updated = TestUtils.createMockApp(DEFAULT_NS);
     updated.getMetadata().setResourceVersion(resourceVersion);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org