FLIP-504: Blue/Green Deployments for Flink on Kubernetes - Phase 2 (WIP)#1043
Draft
schongloo wants to merge 10 commits into
Draft
FLIP-504: Blue/Green Deployments for Flink on Kubernetes - Phase 2 (WIP)#1043schongloo wants to merge 10 commits into
schongloo wants to merge 10 commits into
Conversation
Contributor
Author
|
FYI @drossos @ryanvanhuuksloot |
schongloo
force-pushed
the
flip-504
branch
2 times, most recently
from
March 5, 2026 22:18
2955979 to
25999b7
Compare
schongloo
force-pushed
the
flip-504
branch
2 times, most recently
from
April 14, 2026 05:05
dfa344c to
48413e4
Compare
Replacing the hardcoded subtaskIndex guard for configMap writes with a timer based approach.
Additional defensive configMap keys check
Updates the advanced Blue/Green mode on top of the 1.16 rebase: - field-path watermark extractor: gate on a POJO field path without custom extractor code - transitionMode immutability: reject changing it after the initial deployment (IMMUTABLE_FIELD_CHANGED diff type + SpecDiff check) - validation-error rejection path that emits operator Events - GateProcessFunction closes the Kubernetes client on shutdown - @JsonInclude(NON_NULL) on the Blue/Green status for clean server-side-apply patches - null-safety hardening in the transition utils and ConfigMap lookups - bluegreen-agent / bluegreen-client modules bumped to 1.16-SNAPSHOT Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
This draft PR presents the initial idea for Advanced Coordination for Blue/Green Deployments.
FLIP-503 introduced the Basic Blue/Green Deployment functionality to the Flink K8s Operator. It was very straightforward, simply transitioning to the second deployment once it's considered stable. This Advanced version brings about the notion of "record-level" coordination between the 2 deployments to have no data duplication and exactly once semantics while preserving a smooth transition.
This functionality is NOT ready for the general public as some edge cases have only simple workarounds or remain unaddressed. Some examples of this are:
The main goals of this Draft PR are:
Brief change log
bluegreen.gate.watermark.field-path(dot-notation POJO field path), an alternative to a customextractor-class, implemented byFieldPathWatermarkExtractor.transitionModenow defaults to BASIC, declared on both the CRD schema (default: "BASIC") and the spec type, so existing deployments thatomit the field (Phase 1 / basic mode) keep working on upgrade instead of erroring.
transitionModeis now immutable after the initial deployment; an attempted change is rejected with a validation error that reverts the spec and emits a WarningEvent(no silent re-deploy).Transparent Gate Injection
When transitionMode: ADVANCED is used and bluegreen.gate.strategy is set in flinkConfiguration, the operator automatically:
The following properties are set transparently by the operator and do not need to be specified by the user:
bluegreen.gate.injection.enabledenv.java.opts.jobmanager(the -javaagent flag is appended automatically)The only user-facing configuration needed is:
Gate injection position controls where in the StreamGraph the gate operator is inserted:
To opt out of automatic injection and place the Gate programmatically, only specify
bluegreen.gate.injection.enabled: "false"explicitly.Verifying this change
This change added tests and can be verified as follows:
FlinkBlueGreenDeploymentControllerTest: exercises the full advanced state machine (transitions, gate ConfigMap, validation/immutability rejection).FieldPathWatermarkExtractorTestfor the no-code extractor.Does this pull request potentially affect one of the following parts:
CustomResourceDescriptors: (yes / no)Documentation