Prem Santosh created FLINK-38548:
------------------------------------

             Summary: Blue/Green Deployments 
                 Key: FLINK-38548
                 URL: https://issues.apache.org/jira/browse/FLINK-38548
             Project: Flink
          Issue Type: Bug
          Components: Kubernetes Operator
            Reporter: Prem Santosh


Hi [~gyfora] and [~schongloo], thanks so much for contributing FLINK-38420.

In our initial testing of the feature, we found that the adjustNameReferences 
method blanket replaces all occurrences of the deployment name in the spec with 
a suffixed version of the name with -blue or -green: 
[https://github.com/apache/flink-kubernetes-operator/blob/main/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/bluegreen/BlueGreenUtils.java#L62-L81]
{code:java}
    public static <T> T adjustNameReferences(
            T spec,
            String deploymentName,
            String childDeploymentName,
            String wrapperKey,
            Class<T> valueType) {
        String serializedSpec = SpecUtils.writeSpecAsJSON(spec, wrapperKey);
        String replacedSerializedSpec = serializedSpec.replace(deploymentName, 
childDeploymentName);
        return SpecUtils.readSpecFromJSON(replacedSerializedSpec, wrapperKey, 
valueType);
    }
{code}
We use the deployment name in various fields such as metrics scope, checkpoint 
and savepoint directories, and even configmap names in the taskmanager and 
jobmanager pod templates. The blanket replacement breaks operations such as 
restoring the deployment from savepoint since the initialSavepointPath field 
also gets rewriten.

We would like to submit a patch to remove the call to adjustNameReferences, and 
change only the child deployment names to include the blue/green suffixes if 
possible. Creating a Jira ticket first per the contributor guide.

Sharing the code change we'll submit as a PR upstream if the contributors 
agree: [https://github.com/lyft/flink-kubernetes-operator/pull/1/files]

Thanks!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to