Skip to content

Commit 9d69454

Browse files
committed
Update docs for the new feature
1 parent e334718 commit 9d69454

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

docs/spark_custom_resources.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,49 @@ application (and therefore all its associated resources) after given timeout. If
310310
is configured to restart, `resourceRetainPolicy`, `resourceRetainDurationMillis` and
311311
`ttlAfterStopMillis` would be applied only to the last attempt.
312312

313+
For example, if an app with below configuration:
314+
315+
```yaml
316+
applicationTolerations:
317+
restartConfig:
318+
restartPolicy: OnFailure
319+
maxRestartAttempts: 1
320+
resourceRetainPolicy: Always
321+
resourceRetainDurationMillis: 30000
322+
ttlAfterStopMillis: 60000
323+
```
324+
325+
ends up with status like:
326+
327+
```yaml
328+
status:
329+
#... the 1st attempt
330+
"5":
331+
currentStateSummary: Failed
332+
"6":
333+
currentStateSummary: ScheduledToRestart
334+
# ...the 2nd attempt
335+
"11":
336+
currentStateSummary: Succeeded
337+
"12":
338+
currentStateSummary: TerminatedWithoutReleaseResources
339+
```
340+
341+
The retain policy only takes effect after the final state `12`. Secondary resources are always
342+
released between attempts between `5` and `6`. TTL would be calculated based on the last state as
343+
well.
344+
345+
| Field | Type | Default Value | Description |
346+
|-----------------------------------------------------------|-----------------------------------|---------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
347+
| .spec.applicationTolerations.resourceRetainPolicy | `Always` / `OnFailure` / `Never` | Never | Configure operator to delete / retain secondary resources for an app after it terminates. |
348+
| .spec.applicationTolerations.resourceRetainDurationMillis | integer | -1 | Time to wait in milliseconds for releasing **secondary resources** after termination. Setting to negative value would disable the retention duration check for secondary resources after termination. |
349+
| .spec.applicationTolerations.ttlAfterStopMillis | integer | -1 | Time-to-live in milliseconds for SparkApplication and **all its associated secondary resources**. If set to a negative value, the application would be retained and not be garbage collected by operator. |
350+
351+
Note that `ttlAfterStopMillis` applies to the app as well as its secondary resources. If both
352+
`resourceRetainDurationMillis` and `ttlAfterStopMillis` are set to non-negative value and the
353+
latter is smaller, then it takes higher precedence: operator would remove all resources related
354+
to this app after `ttlAfterStopMillis`.
355+
313356
## Spark Cluster
314357

315358
Spark Operator also supports launching Spark clusters in k8s via `SparkCluster` custom resource,

0 commit comments

Comments
 (0)