dalelane opened a new pull request, #1265: URL: https://github.com/apache/flink-kubernetes-operator/pull/1265
This PR depends on #1223, #1259, #1261, #1262, #1263, #1264 Please only review the last **7 commits**, prefixed with FLINK-40867 If it helps with reading, you can see a draft PR with just those seven commits in my fork at https://github.com/dalelane/flink-kubernetes-operator/pull/6 --- Pending pull requests for [FLIP-611](https://cwiki.apache.org/confluence/spaces/FLINK/pages/451974246/FLIP-611+Running+Flink+jobs+in+MiniCluster+using+the+Kubernetes+Operator): - https://github.com/apache/flink-kubernetes-operator/pull/1223 - https://github.com/apache/flink-kubernetes-operator/pull/1259 - https://github.com/apache/flink-kubernetes-operator/pull/1261 - https://github.com/apache/flink-kubernetes-operator/pull/1262 - https://github.com/apache/flink-kubernetes-operator/pull/1263 - https://github.com/apache/flink-kubernetes-operator/pull/1264 --- ## What is the purpose of the change This pull request adds `FlinkMiniCluster` as an accepted `jobReference.kind` of a `FlinkStateSnapshot`, so savepoints and checkpoints for minicluster jobs can be triggered, observed and disposed. This will enable jobs to be moved between `FlinkMiniCluster` and `FlinkDeployment`. It also fixes an existing bug in how snapshots are mapped to their resources. Each Flink resource controller watches `PERIODIC` and `UPGRADE` snapshots, and mapped each one to the resource with the job reference's name, whatever its kind. JOSDK also uses this mapping to decide a resource's secondary snapshots. Resources of different kinds can share a name in a namespace, so a resource could treat another kind's snapshots as its own. It would count them when timing periodic triggers, and delete them during savepoint history cleanup. Snapshots now only map to a resource of the kind named in the job reference. ## Brief change log - state snapshot context, observer and reconciler now work with any `AbstractFlinkResource` as the referenced job's cluster, instead of assuming `FlinkDeployment` - `FLINK_MINI_CLUSTER` is added to the `JobKind` API enum, and `JobReference` handles it - Snapshot-to-resource mapping in `EventSourceUtils` checks the job reference kind. All controllers share this mapping, and the copy in the `FlinkSessionJob` event source is removed - `FlinkMiniClusterController` registers the snapshot informer event source, and the `FlinkStateSnapshot` controller gains a `FlinkMiniCluster` event source - The admission webhook's `InformerManager` maintains `FlinkMiniCluster` informers, and `FlinkValidator` uses them to look up a referenced `FlinkMiniCluster` when validating snapshots - Doc updates: CRD reference, startup/webhook internals, and the `SnapshotAbandoned` event description ## Verifying this change This change added tests ## Does this pull request potentially affect one of the following parts: - Dependencies (does it add or upgrade a dependency): no - The public API, i.e., is any changes to the `CustomResourceDescriptors`: yes - Core observer or reconciler logic that is regularly executed: no ## Documentation - Does this pull request introduce a new feature? yes - If yes, how is the feature documented? Documenting the new feature will be done in FLINK-40869 --- ##### Was generative AI tooling used to co-author this PR? - [ ] Yes (please specify the tool below) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
