You could directly run the Flink job in local mode with java command. But you need to construct the Flink classpath and set it to the start command. An easier way is to build your image based on the Flink official image and copy your jar into the image. I believe you have done this. Then you could use the following yaml to create a K8s job to start the Flink job in the local mode.
Refer here[1] for more information about how to build a runnable jar. [1]. https://ci.apache.org/projects/flink/flink-docs-master/dev/packaging.html *apiVersion: batch/v1kind: Jobmetadata: name: flink-local-jobspec: template: metadata: labels: app: flink-local-job spec: restartPolicy: OnFailure containers: - name: flink-local-job image: flink:1.11.3 args: ["bash", "-c", "/opt/flink/bin/flink run --target local /opt/flink/examples/streaming/WindowJoin.jar"]* Best, Yang Salva Alcántara <salcantara...@gmail.com> 于2021年1月15日周五 下午3:22写道: > Can anyone explain why I am getting this error? > > "Exception in thread "main" java.lang.IllegalStateException: No > ExecutorFactory found to execute the application." > > I have tried a slightly different approach by running the jar that `sbt > assembly`produces inside a container that looks like this (Dockerfile): > > ``` > FROM flink:1.11.2-scala_2.12-java11 > COPY ./path/to/my.jar my.jar > ``` > > I have tried with different versions of flink (1.10.2 for example) and I am > getting the same error. This should be pretty straightforward but I cannot > make it work. My main looks like this > > ``` > object MyApp extends App { > ... > val env: StreamExecutionEnvironment = > StreamExecutionEnvironment.getExecutionEnvironment > > ... > env.execute > } > ``` > > and it fails when it reaches the call to `getExecutionEnvironment`... > > > > > -- > Sent from: > http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/ >