-
Notifications
You must be signed in to change notification settings - Fork 48
[SPARK-54789] Support label selector based filter on resources to reconcile #439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…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
|
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. | |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
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