datus-flink-plugin
A skill-only Datus plugin for creating and operating Apache Flink jobs. It bundles two skills, one per stage of a job's life:
| Skill | Use it for |
|---|---|
flink-local-dev |
Running a Flink SQL job on the current machine, in an in-process MiniCluster, to validate its logic before it goes anywhere |
flink-k8s-operator |
Building, deploying, and operating the job on the Apache Flink Kubernetes Operator |
The plugin intentionally declares no datus flink CLI and no Flink profiles.
flink-local-dev drives the Flink SQL Client in the local shell;
flink-k8s-operator builds JVM or PyFlink projects, prepares Operator custom
resources, and delegates every Kubernetes workload operation to the separately
installed datus k8s plugin.
Each skill is a single SKILL.md — Datus discovers the skill file only, so a
skill directory cannot ship an assets/ or references/ subdirectory. Every
template the skills hand to a project (Operator manifests, Dockerfiles, the SQL
overlays, the local runner script) is inlined in the skill file under a
### <filename> heading, and the test suite extracts those blocks to check them.
Install
Install and configure the Kubernetes plugin first — it is needed for the deployment stage, not for local validation:
datus plugin install src:./datus-k8s-plugin
Then install this plugin:
datus plugin install src:./datus-flink-plugin
Both skills appear in the Datus skill catalogue. Invoke flink-local-dev when
writing or debugging a Flink SQL job; invoke flink-k8s-operator when creating,
upgrading, suspending, resuming, snapshotting, or diagnosing a FlinkDeployment
or FlinkSessionJob.
Local validation, then production
The intended path for a Flink SQL job:
flink-local-dev— run the script in a MiniCluster inside one JVM. No Docker, no Kubernetes, no shared cluster. Sources may be real development endpoints; every sink is shadowed withprint,blackhole, or a localfile://table, so the run cannot write to a real system. Judge the output rows, changelog kinds, and counts against what the query should produce.flink-k8s-operator— package the validated script, deliver the image, render the FlinkDeployment or FlinkSessionJob, and apply it throughdatus k8s.
The production artifact (sql/job.sql) is byte-identical in both stages;
everything local lives in a separate, never-shipped overlay:
deploy/flink/<name>/
├── sql/job.sql # the artifact — unchanged between stages
├── local/ # flink-local-dev overlay (git-ignore credentials)
│ ├── local-session.sql # pins execution.target=local, table.dml-sync=true
│ ├── local-sources.sql # bounded, read-only dev source shadows
│ ├── local-sinks.sql # print / blackhole / file:// sink shadows
│ └── run-local-sql.sh # preflight + guards + SQL Client invocation
└── flinkdeployment.yaml # flink-k8s-operator output
run-local-sql.sh fails closed: it refuses to run when the session overlay does
not pin the local execution target and synchronous DML, when an INSERT target
has no local shadow, when a sink connector or path is not local, or when an
overlay carrying a credential is tracked by git.
Local validation needs a Flink distribution on the machine (FLINK_HOME) whose
minor version matches the production spec.flinkVersion, and a JDK that release
supports. It does not need Docker or cluster access.
Runtime boundary
- Flink Operator installation, CRDs, cluster RBAC, and webhooks are managed by the Kubernetes administrator.
- Flink workload reads and writes use
datus k8sand inherit its namespace allowlist and confirmation policy. - A local run never writes to a production sink, consumer group, CDC slot, or checkpoint path, and never builds or pushes a production image.
- Application jobs may package a JAR or Python project into a custom Flink image.
- Session jobs normally use an Operator-accessible HTTPS, S3, or HDFS
artifact URI. A
local://URI refers to the Operator pod filesystem, not merely the Session Cluster image. - The Operator submits jars, not SQL scripts: a validated SQL script reaches production through a SQL runner jar or a SQL Gateway, decided per project.
The initial schema guidance targets the stable Operator 1.15 API while
discovering the actual flink.apache.org resource version from the target
cluster before generating a manifest.
Develop
uv run --package datus-flink-plugin pytest datus-flink-plugin
The suite renders every template, checks the documented invariants, and drives
run-local-sql.sh against a fake Flink distribution to prove each guard rejects
what it claims to reject. The package contains no runtime Python implementation
and never imports or depends on datus.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file datus_flink_plugin-0.1.0.tar.gz.
File metadata
- Download URL: datus_flink_plugin-0.1.0.tar.gz
- Upload date:
- Size: 33.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
596d8ea03b1f506bc55d60dabf2ec7999f3d8971c9ceeb0f95c8d29d0e60f889
|
|
| MD5 |
38d4de813fd331b3661a3092156a8941
|
|
| BLAKE2b-256 |
dd1b6db3d1cee6948d8384bacad5533e5d7ce1ce304b81becf21d17b439313bd
|
File details
Details for the file datus_flink_plugin-0.1.0-py3-none-any.whl.
File metadata
- Download URL: datus_flink_plugin-0.1.0-py3-none-any.whl
- Upload date:
- Size: 26.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca73ec64f3554dd14852da1c24731780dbcd2d51e2a3095d3735f67053dc2d11
|
|
| MD5 |
c09f456a50f9d0e5f2bd352b4ac61c3c
|
|
| BLAKE2b-256 |
b444d8509ff5b913f7f2aef535898c39f879c685f85bc7f7ef697e710de17732
|