Skip to content

Conversation

@jiangzho
Copy link
Contributor

What changes were proposed in this pull request?

This PR adds a new property spark.kubernetes.operator.reconciliationSelectors. If set to non empty value, operator would only reconcile custom resources that match the given selector filter. By default, operator would still reconcile all resources.

Why are the changes needed?

Introducing optional label based selectors allows operator to reconcile only a targeted subset of custom resources when configured explicitly.

It's a common case for user to leverage label for isolation on resources. This can be a result of various reason, including setting-up multiple operator per environment / group in shared clusters, or for progressive adoption upon new versions. This feature would make operator fits better for prod level multi-tenant environments.

Does this PR introduce any user-facing change?

New property becomes available while behavior is the same as before by default.

How was this patch tested?

Existing e2e validates the default behavior. Added new scenario to test selector functionality.

Was this patch authored or co-authored using generative AI tooling?

No

…oncile

### What changes were proposed in this pull request?

This PR adds a new property `spark.kubernetes.operator.reconciliationSelectors`. If set to non empty value, operator would only reconcile custom resources that match the given selector filter. By default, operator would still reconcile all resources.

### Why are the changes needed?

Introducing optional label based selectors allows operator to reconcile only a targeted subset of custom resources when configured explicitly.

It's a common case for user to leverage label for isolation on resources. This can be a result of various reason, including setting-up multiple operator per environment / group in shared clusters, or for progressive adoption upon new versions. This feature would make operator fits better for prod level multi-tenant environments.

### Does this PR introduce any user-facing change?

New property becomes available while behavior is the same as before by default.

### How was this patch tested?

Existing e2e validates the default behavior. Added new scenario to test selector functionality.

### Was this patch authored or co-authored using generative AI tooling?

No
@jiangzho
Copy link
Contributor Author

cc @peter-toth for review - many thanks in advance!

| spark.kubernetes.operator.reconciler.retry.maxIntervalSeconds | Integer | -1 | false | Max interval(in seconds) of retries on unhandled controller errors. Set to non-positive for unlimited. |
| spark.kubernetes.operator.reconciler.terminationTimeoutSeconds | Integer | 30 | false | Grace period for operator shutdown before reconciliation threads are killed. |
| spark.kubernetes.operator.reconciler.trimStateTransitionHistoryEnabled | Boolean | true | true | When enabled, operator would trim state transition history when a new attempt starts, keeping previous attempt summary only. |
| spark.kubernetes.operator.reconciliationSelectors | String | | false | Comma-separated label selector(s) that the operator would be reconciling for Spark resources. If not set or set to empty string, operator would reconcile all watched Spark Apps and Clusters. |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we reuse the existing namespace, spark.kubernetes.operator.reconciler, like this? And, selector might be better because we use spark-app-selector and spark.kubernetes.node.selector.* before, @jiangzho .

- spark.kubernetes.operator.reconciliationSelectors
+ spark.kubernetes.operator.reconciler.selector

- name: JAVA_VERSION
value: "17"
- name: IMAGE
value: "apache/spark:4.1.0-scala-java17"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use apache/spark:4.1.0-scala because we are currently advertising Java 21 over 17.

- name: SPARK_VERSION
value: "4.1.0"
- name: JAVA_VERSION
value: "17"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto. Java 21 please.

spark.kubernetes.executor.request.cores: "0.5"
runtimeVersions:
sparkVersion: ($V_SPARK_VERSION)
jdkVersion: ($V_JAVA_VERSION)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we remove this because technically jdkVersion didn't provide a meaningful effect in the community?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants