Grypse commented on code in PR #357:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/357#discussion_r958557976


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/observer/deployment/AbstractDeploymentObserver.java:
##########
@@ -141,41 +148,19 @@ protected void observeJmDeployment(
             return;
         }
 
-        Optional<Deployment> deployment = 
context.getSecondaryResource(Deployment.class);
-        if (deployment.isPresent()) {
-            DeploymentStatus status = deployment.get().getStatus();
-            DeploymentSpec spec = deployment.get().getSpec();
-            if (status != null
-                    && status.getAvailableReplicas() != null
-                    && spec.getReplicas().intValue() == status.getReplicas()
-                    && spec.getReplicas().intValue() == 
status.getAvailableReplicas()
-                    && flinkService.isJobManagerPortReady(effectiveConfig)) {
-
-                // typically it takes a few seconds for the REST server to be 
ready
-                logger.info(
-                        "JobManager deployment port is ready, waiting for the 
Flink REST API...");
-                deploymentStatus.setJobManagerDeploymentStatus(
-                        JobManagerDeploymentStatus.DEPLOYED_NOT_READY);
+        if 
(KubernetesDeploymentMode.NATIVE.equals(flinkApp.getSpec().getMode())) {
+            Optional<Deployment> deployment = 
context.getSecondaryResource(Deployment.class);
+            if (deployment.isPresent()) {
+                jmDeploymentObserver(deployment.get(), effectiveConfig, 
deploymentStatus, flinkApp);
                 return;

Review Comment:
   With StatefulSet for JobManager has the following advantages:
   
   1. Avoid random string suffix of JM Pod, more intuitive identification of JM.
   2. There is no need to manually create the PVC each time, which is very 
convenient when you need to create many flink clusters in production.
   3. When JM replicas is greater than 1, the one-to-one correspondence between 
PVC and JM can be guaranteed.



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to