rpk transform deploy
Deploy a data transform.
When run in the same directory as a transform.yaml, this reads the configuration file, then looks for a .wasm file with the same name as your project. If the input and output topics are specified in the configuration file, those are used. Otherwise, the topics can be specified on the command line using the --input-topic and --output-topic flags.
You can specify environment variables for the transform using the --var flag. Variables are separated by an equal sign. For example: --var=KEY=VALUE. The --var flag can be repeated to specify multiple variables.
You can specify the --from-offset flag to identify where on the input topic the transform should begin processing. Expressed as:
-
@T- Begin reading records with committed timestamp >= T (UNIX time, ms from epoch) -
+N- Begin reading N records from the start of each input partition -
-N- Begin reading N records prior to the end of each input partition
Note that the broker will only respect --from-offset on the first deploy for a given transform. Re-deploying the transform will cause processing to pick up at the last committed offset. This state is maintained until the transform is deleted.
Flags
| Value | Type | Description |
|---|---|---|
|
string |
Output batch compression type. |
|
string |
The WebAssembly module to deploy. |
|
string |
Process an input topic partition from a relative offset. |
|
- |
Help for deploy. |
|
string |
The input topic to apply the transform to. |
|
string |
The name of the transform. |
|
strings |
The output topic to write the transform results to (repeatable). |
|
environmentVariable |
Specify an environment variable in the form of KEY=VALUE. |
|
string |
Redpanda or |
|
stringArray |
Override |
|
string |
Profile to use. See |
|
- |
Enable verbose logging. |
Examples
Deploy Wasm files directly without a transform.yaml file:
rpk transform deploy --file transform.wasm --name myTransform \
--input-topic my-topic-1 \
--output-topic my-topic-2
--output-topic my-topic-3
Deploy a transformation with multiple environment variables:
rpk transform deploy --var FOO=BAR --var FIZZ=BUZZ
Configure compression for batches output by data transforms. The default setting is none but you can choose from the following options:
-
none
-
gzip
-
snappy
-
lz4
-
zstd
Configure this at deployment using rpk with the --compression flag:
rpk transform deploy --compression <compression_type>