How to pre upload jar file on Flink Session Cluster Instead of adding manually from the Web UI

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to pre upload jar file on Flink Session Cluster Instead of adding manually from the Web UI

Robert Cullen
I have a Kubernetes cluster with Flink running in Session Mode.

Is there a way to drop the jar file into a folder and/or add it to the Docker image?


--
Robert Cullen
240-475-4490
Reply | Threaded
Open this post in threaded view
|

Re: How to pre upload jar file on Flink Session Cluster Instead of adding manually from the Web UI

Yang Wang
Hi Robert,

After checking the JarRunHandler implementation, I think you requirement could be done as following steps.

1. Use the init container to download the user jars or directly baked jars into the image under path /path/of/flink-jars/flink-web-upload
2. Set the Flink configuration option "web.upload.dir: /path/of/flink-jars" for your session cluster. Please note that do not contains the "flink-web-upload" sub directory.
3. Submit the job via the curl command

curl -H "Content-Type: application/json" -X POST -d '{"entryClass":"org.apache.flink.streaming.examples.statemachine.StateMachineExample","parallelism":null,"programArgs":null,"savepointPath":null,"allowNonRestoredState":null}' http://localhost:8081/jars/StateMachineExample.jar/run


Moreover, you could also have a try with the application mode. Both the standalone[1] and native application[2] mode could meet your requirements with better isolation.



Best,
Yang


Robert Cullen <[hidden email]> 于2021年2月4日周四 上午4:04写道:
I have a Kubernetes cluster with Flink running in Session Mode.

Is there a way to drop the jar file into a folder and/or add it to the Docker image?


--
Robert Cullen
240-475-4490