Skip to main content

Deploying your Flink job

Deploying

To deploy a Flink job on Immerok Cloud you only need to create a Job resource. The Job references an Artifact that contains your Flink Program.

Job Creation via create

The easiest way to create a Job (and Artifact) is via rok create job. The only mandatory information you need to provide is a name for the Job and the path to a file to create this Artifact from. The file should be in the local filesystem or accessible via http(s).


_8
$ rok create job my-job --file my-job.jar
_8
_8
👀 Creating new Artifact "my-job".
_8
✔ Created new resource.
_8
✔ Uploaded [100% (15 MiB/15 MiB)]
_8
_8
👀 Creating a new Job.
_8
✔ job.core/my-job has been created.

The rok create job command offers additional flags to configure your Job during creation, like --rpus to set the number of RPUs (Rok Processing Units) for the Job.

You can also create the Artifact and Job separately via rok create artifact and rok create job --artifact <artifact_name>.

See Also

See Jobs and Artifacts to learn about the lifecycle of Artifacts and Jobs.

Job Creation via apply

rok apply allows you to idempotently create and modify Immerok Cloud resources. With rok apply you control the full configuration of the Job resource and can easily manage your Immerok Cloud resources via GitOps and similar approaches to CI/CD.


_9
$ rok create artifact my-job-artifact \
_9
--flink-version 1.15 \
_9
--zone shared-aws-us-east-1 \
_9
--type JAR \
_9
--from-file my-job.jar
_9
_9
✔ Created new resource.
_9
✔ Uploaded [100% (15 MiB/15 MiB)]
_9
✔ artifact.core/my-job-artifact has been created.

job.yaml

_14
apiVersion: core/v1alpha1
_14
kind: Job
_14
zone: shared-aws-eu-west-1
_14
metadata:
_14
name: my-job
_14
project: default
_14
spec:
_14
flinkVersion: 1.15
_14
artifactRef:
_14
name: my-job-artifact
_14
resources:
_14
rpus: 7
_14
configuration:
_14
execution.checkpointing.interval: 10s #custom checkpointing interval


_3
$ rok apply -f job.yaml
_3
_3
✔ job.core/my-job has been created.