Deploying Flink applications
Learn more about how to deploy Flink applications.
-
Define the
spec.job
in theFlinkDeployment
configuration 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: stateless
The following properties are required for the application deployment:Property Description jarURI
URI of the Flink job JAR file in the Docker image. parallelism
Parallelism of the Flink job. state
State of the Flink job that can be running or suspended. upgradeMode
Upgrade 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