Skip to content

Commit 3dba943

Browse files
committed
Update docs for the new feature
1 parent e334718 commit 3dba943

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

docs/spark_custom_resources.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,44 @@ 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 | String (`Always` / `OnFailure` / `Never`) | Never | Configure operator to delete / retain secondary resources for an app after it terminates. |
348+
| .spec.applicationTolerations.resourceRetainDurationMillis | integer | -1 or `ttlAfterStopMillis`, if the latter is set | Time to wait for releasing secondary resources after app termination. If `resourceRetainPolicy` is not `Never` and this is set to a negative value, operator would retain secondary resources with the same lifecycle as the application itself. If set to a positive value that's greater than `ttlAfterStopMillis`, the latter would take higher precedence. Operator may delete application and all secondary resources after `ttlAfterStopMillis`. |
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+
313351
## Spark Cluster
314352

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

0 commit comments

Comments
 (0)