Hello :wave: I have a question about Flink Kuberne...
# troubleshooting
v
Hello 馃憢 I have a question about Flink Kubernetes Operator: I deployed Flink operator 1.8.0 and submitted a
FlinkDeployment
CR in native, stateless Application mode. The job is bounded, it鈥檚 an hello world example (code in the comment). The job runs and finishes normally, I can see the job status is
FINISHED
and the lifecycle state is
STABLE
. However, as the job finished, I expect the cluster to be deleted, but it is not. Only the task manager is deleted, the job manager is still there, idling. I found this option
kubernetes.operator.jm-deployment.shutdown-ttl
which is default to 1 day, and changed it to 1 minute. Afterwards, the job manager was deleted but then the operator decided to spin up the cluster again, changing the CR鈥檚 status to
RECONCILING
and re-run the job. The job then terminates, the cluster is destroyed, and the operator spin it up again, in a loop. I don鈥檛 think it鈥檚 a normal behaviour of a batch job. I expect a batch job in application mode would spin up a Flink cluster and tear it down after finish. Can someone shed some light on this issue please? Thanks.
Copy code
public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(1);
        String input = "Hello World!";
        env.fromElements(input).flatMap(new FlatMapFunction<String, Tuple2<String, Integer>>() {
            @Override
            public void flatMap(String value, Collector<Tuple2<String, Integer>> collector) throws Exception {
                for (String s : value.split(" ")) {
                    collector.collect(Tuple2.of(s, 1));
                }
            }
        }).keyBy(0).sum(1).print();
        env.execute();
    }
g
This doesn鈥檛 sounds right, can you please share the opeartor logs where we see that it deletes then restarts the job?
Actually please open a JIRA ticket
馃憤 1
l
I faced the similar issue on my job before. I fixed it by setting below option:
kubernetes.operator.jm-deployment-recovery.enabled: false
. Just wondering if it worthing checking your settings.
g
@Lily Liu these 2 things should be unrelated and should not cause any issues to have it enabled. I suspect the issue lies there (based on your workaround). But it sounds more like a bug 馃檪
l
Oh? Thank you for your clarification. I thought my setting was wrong. My batch job was restarting again and again with above option enabled.
g
If @Vu-Hoang Phan opens the Jira ticket we can look at the root case, and it鈥檚 probably the deployment recovery logic in that case 馃檪
l
I will check if I can reproduce the issue and if there is any useful logs. Just in case if they might be helpful.
v
@Gyula F贸ra This is the operator logs around the time it deletes and restarts the job. I don鈥檛 have an ASF account so I can鈥檛 create a Jira ticket right now, but I鈥檝e just submitted an account creation request.
g
Yes clearly the deployment recovery logic kicks in incorrectly, as @Lily Liu said. Setting `kubernetes.operator.jm-deployment-recovery.enabled: false`should be a good workaround until we fix this properly
馃憤 1
I have opened a ticket, the fix is simple I will open a PR soon: https://issues.apache.org/jira/browse/FLINK-35108
v
Thanks a lot Gyula 馃槈