Deploying Flink applications
Learn more about how to deploy Flink applications.
-
Define the
spec.jobin theFlinkDeploymentconfiguration file to create an application deployment as shown in the following example:apiVersion: flink.apache.org/v1beta1 kind: FlinkDeployment metadata: name: flink-kubernetes-tutorial spec: image: [***REGISTRY HOST***]:[***PORT***]/[***PROJECT***]/flink-kubernetes-tutorial:latest flinkVersion: v1_18 flinkConfiguration: taskmanager.numberOfTaskSlots: "4" serviceAccount: flink mode: native jobManager: resource: memory: "2048m" cpu: 1 taskManager: resource: memory: "2048m" cpu: 1 job: args: ["--rowsPerSec", "10"] jarURI: local:///opt/flink/usrlib/flink-kubernetes-tutorial.jar parallelism: 4 state: running upgradeMode: statelessThe following properties are required for the application deployment:Property Description jarURIURI of the Flink job JAR file in the Docker image. parallelismParallelism of the Flink job. stateState of the Flink job that can be running or suspended. upgradeModeUpgrade mode of the Flink job that can be one of the following: stateless: No state will be savedlast-state: Uses Flink high availability metadata to resume jobssavepoint: Uses Flink savepoints to cancel and resume jobs
-
Submit the YAML file to run the application when configuring the
FlinkDeployment resource is complete:
kubectl apply -f your-deployment.yaml
