Hello, I would like to get some opinions, insights...
# troubleshooting
n
Hello, I would like to get some opinions, insights or solutions for the following problem I am facing. --> It is related to flink kubernetes operator: https://nightlies.apache.org/flink/flink-kubernetes-operator-docs-main/
---- before introduction of flink kubernetes operator ----
A component in the platform I am working, is providing framework code so that a user could designate-instruct all jobs of job manager to gracefully shutdown with a savepoint. What is doing pretty much behind the scenes is to leverage the Flink Rest API, with the following order: 1. it is calling the GET /jobs endpoint of the jobmanager to get all the job ids [see attached screen] 2. and then for every job id was stopping the job with POST /jobs/:jobid/stop [see attached screen] So everything was working as expected. But....
---- after introduction of flink kubernetes operator -----
because the state is passed in the yaml (eg: state: running), and get managed from Control Plane of k8s, etc. the above does not work -- seems to getting ignored from flink kubernetes operator, so whole above mentioned mechanics are not working in a flink kubernetes operator deployment setup.
So my question is the following:
Is there a similar API provided from kubernetes operator so that we can designate job manager to do things we wish (eg: stop jobs) and solve the above issue?
m
Hi @nick christidis. If you change the state of your job the kubernetes operator needs to be aware of this, so if you specified in your
FlinkDeployment
CR that your application should be running but you cancel it manually then the operator will restart it. All job management needs to go through the operator in a case like this, please refer to https://nightlies.apache.org/flink/flink-kubernetes-operator-docs-main/docs/custom-resource/job-management/ for the details.
n
ok @Marton Balassi so there is not any API - code specific that I can do the same with the Flink Operator, which I did with Flink Rest API before I introduced k8s operator, right?
m
There is an API, you need to make changes to your
FlinkDeployment
CR. This essentially means that you are talking to the Kubernetes REST API server instead of the Flink JobManager REST API. We even offer a Java client, see https://github.com/apache/flink-kubernetes-operator/tree/main/examples/kubernetes-client-examples.
n
@Marton Balassi thanks a lot for your input!!!