DocumentationReferenceV1Alpha1

API Reference

Resources Types

KasprApp

A program that runs components of a distributed stream processing application.

FieldTypeDefaultRequired
apiVersionstring

kaspr.io/v1alpha1

Yes
kindstring

KasprApp

Yes
metadataObjectMeta

{}

Yes

Metadata that all persisted resources must have.

KasprAppSpec

Specification of the desired settings of the application.

FieldTypeDefaultRequired
versionstringNo

The kaspr version. Defaults to the latest.

replicasinteger

1

No

The number of desired instances.

imagestringNo

The container image to use. Defaults to the corresponding image of the version configuration.

bootstrapServersstringYes

Bootstrap server names to connect to. This should be given as a comma separated list of <hostname>:<port> pairs.

tlsTLSNo

TLS configuration. Provide an empty entry {} to enable TLS or exclude the field to disable TLS.

authenticationKafkaAuthenticationNo

Authentication configuration for Kafka.

resourcesResourceRequirementsNo

Compute Resources required by each instance on the application.

storageStorageRequirementsYes

Disk storage required by each instance of the application.

KasprAppConfig

KasprApp configuration parameters.

FieldTypeDefaultRequired
topicReplicationFactorinteger

3

No

The default replication factor for topics created by the application.

topicPartitionsinteger

3

No

Default number of partitions for topics created by the application.

topicAllowDeclareboolean

false

No

This setting controls whether or not creation of topics is allowed.

schedulerEnabledboolean

false

No

This setting controls whether or not the message scheduler is enabled.

schedulerDebugStatsEnabledboolean

false

No

This setting controls whether or not scheduler debug statistics are printed to log.

schedulerTopicPartitionsintegerNo

Default number of partitions for internal scheduler related topics. Defaults to general topic partition configuration if not set.

schedulerCheckpointSaveIntervalSecondsnumber:float

1.3

No

How often we save checkpoint to storage (and to changelog topic)

schedulerDispatcherDefaultCheckpointLookbackDaysinteger

7

No

Number of days the dispatcher will look back from current date to seek starting a point for dispatching messages when an checkpoint is not found. This is mostly used during initial app deployment.

schedulerDispatcherCheckpointIntervalnumber:float

10.0

No

How often we checkpoint the dispacher's location in the timetable (in seconds).

schedulerJanitorCheckpointIntervalnumber:float

10.0

No

How often we checkpoint the janitor's location in the timetable (in seconds).

schedulerJanitorCleanIntervalSecondsnumber:float

3.0

No

How often the janitor attempts to clean.

schedulerJanitorHighwaterOffsetSecondsnumber:float

14400.0

No

Number of seconds the janitor trails current from the highwater timetable location.

storeRocksdbWriteBufferSizeinteger

67108864

No

This is the maximum write buffer size. It represents the amount of data to build up in memory before converting to a sorted on-disk file. The default is 64 MB.

storeRocksdbMaxWriteBufferNumberinteger

3

No

Maximum number of write buffers (memtables) that can be built in memory at the same time.

storeRocksdbTargetFileSizeBaseinteger

67108864

No

Target size for files at level-1 in the LSM tree. Used to determine the size of the SST (Sorted String Table) files that RocksDB generates during compactions. The default is 64 MB.

storeRocksdbBlockCacheSizeintegerNo

Size for caching uncompressed data. Defauls to about 30% of application's total memory budget

storeRocksdbBlockCacheCompressedSizeinteger

268435456

No

Size for caching compressed data. Defaults to 254MB.

storeRocksdbBloomFilterSizeinteger

3

No

A Bloom filter in RocksDB is used to quickly check whether a key might be in an SST (Sorted String Table) file without actually reading the file, which can significantly improve read performance.

storeRocksdbSetCacheIndexAndFilterBlocksboolean

3

No

If set to true, index and filter blocks will be stored in block cache, together with all other data blocks.

webBasePathstringNo

Base HTTP path for serving web requests.

webPortinteger

6065

No

Port number between 1024 and 65535 to use for the web server.

KasprAgent

A distributed system processing events in a stream.

FieldTypeDefaultRequired
apiVersionstring

kaspr.io/v1alpha1

Yes
kindstring

KasprAgent

Yes
metadataObjectMeta

{}

Yes

Metadata that all persisted resources must have. An agent must declare a label kaspr.io/app with the value of the app name it will be run on.

specKasprAgentSpec

{}

Yes

Specification of the desired behavior of the KasprAgent.

KasprAgentSpec

Specification of the desired behavior of the KasprAgent.

FieldTypeDefaultRequired
descriptionstringNo

A short description of the agent for documentation purpose.

inputKasprAgentInput

{}

Yes

Input configuration for the agent.

outputKasprAgentOutput

{}

No

Output configuration for the agent. Processed events are sent out to the optional output.

processorsKasprAgentProcessors

{}

No

Sequence of operations that handle input events. Processors are optional and can be used to modify or act on the input events before they are sent to the output.

KasprAgentInput

Input configuration for the KasprAgent.

FieldTypeDefaultRequired
topicKasprAgentInputTopic

{}

No

Input topic configuration; mutually exclusive with channel.

channelKasprAgentInputChannel

{}

No

Input channel configuration; mutually exclusive with topic.

KasprAgentInputTopic

Input topic configuration for the KasprAgent.

FieldTypeDefaultRequired
namestringNo

Topic names to subscribe to. This can be a single topic or a comma-separated list of topics. Required, but mutually exclusive with pattern.

patternstringNo

Regex pattern of topic names to subscribe to. Required, but mutually exclusive with name.

keySerializerstring

json

No

Serializer for the key portion of the kafka message. Must be one of raw, json, pickle, or binary.

valueSerializerstring

json

No

Serializer for the value portion of the kafka message. Must be one of raw, json, pickle, or binary.

KasprAgentInputChannel

Input channel configuration for the KasprAgent.

FieldTypeDefaultRequired
namestringYes

Name of the channel to subscribe to

KasprAgentOutput

Output configuration for the KasprAgent.

FieldTypeDefaultRequired
topicsKasprAgentOutputTopic[]

[]

No

List of topics to publish to.

KasprAgentOutputTopic

Output topic configuration for the KasprAgent.

FieldTypeDefaultRequired
namestringYes

Topic name

ackboolean

false

No

Wait for broker acknoledgement before considering the message sent.

keySerializerstring

json

No

Serializer for the key portion of the kafka message. Must be one of raw, json, pickle, or binary.

valueSerializerstring

json

No

Serializer for the value portion of the kafka message. Must be one of raw, json, pickle, or binary.

keySelectorCodeNo

Custom code to be used to select the key of the message. The code must define a function that takes a single argument and returns a value.

valueSelectorCodeNo

Custom code to be used to select the value of the message. The code must define a function that takes a single argument and returns a value.

partitionerSelectorCodeNo

Custom code to be used to select the partition number of the message. The code must define a function that takes a single argument and returns an integer.

headerSelectorCodeNo

Custom code to be used to select the headers of the message. The code must define a function that takes a single argument and returns a key and value map.

predicateCodeNo

Custom code to be used to select the messages to be sent. The code must define a function that takes a single argument and returns a boolean value. Predicates that return true will be sent to the output topic, while those that return false will be discarded.

Code

Injectable custom code that is used achieve a desired outcome in a specific context.

FieldTypeDefaultRequired
entrypointstringNo

Name of the function that is invoked. If code defines multiple functions, the first function is used as the entrypoint. To avoid ambiguity, it is recommended to explicilty specify the entrypoint.

pythonstringYes

Python code to be executed. The code must define a valid Python function to use as an entrypoint.

KasprAgentProcessors

Chain of processors that modify input values.

FieldTypeDefaultRequired
pipelinelist

[]

Yes

Sequence of operations to run.

initobject

{}

No

Initialization code to run.

operationslist

[]

Yes

Chain of operations to run on input events.

KasprAgentProcessorOperation

A transform or action to take on input events.

FieldTypeDefaultRequired
namestringYes

A unique name for the operation. This is used to identify the operation in the pipeline.

tablesKasprAgentProcessorOperationTable[]No

List of tables which are made available in the operation's function.

mapCodeNo

Takes an input value and returns an output value which is passed down to the next operation or the agent's output .

filterCodeNo

Takes an input value and determines if the event is eligible to be passed down to the next operation or the agent's output. If the filter function returns true, the event is passed down, otherwise it is discarded.

KasprAgentProcessorOperationTable

Reference to a KasprTable and how it is made available to an operation’s function.

FieldTypeDefaultRequired
namestringYes

The name of the KasprTable resource.

paramNamestringYes

The name of the parameter in which the table is made available in the operation's function.

KasprWebView

A web view provides an HTTP endpoint to a KasprApp, enabling remote access to the application.

FieldTypeDefaultRequired
namestringYes

Name of the web view interface

descriptionstringNo

A short description of the web view for documentation purpose.

requestKasprWebViewRequestYes

Describes the request endpoint listener.

responseKasprWebViewResponseNo

Describes the web view's response output.

KasprWebViewRequest

Specification for the web view request endpoint.

FieldTypeDefaultRequired
methodstringYes

HTTP method to use for the request. Must be one of GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS

pathstringYes

Web path to listen on.

requestKasprWebViewRequestNo

Describes the request endpoint listener.

KasprWebViewResponse

Specification for the web view’s response output.

FieldTypeDefaultRequired
contentTypestringNo

Response content type. Must be one of text/html, application/json, text/plain, application/octet-stream

statusCodeintegerNo

HTTP status code to return on success.

headersobjectNo

Headers as key and value pairs to return in the response

bodySelectorKasprWebViewResultHandlerNo

Custom function to transform the response body on success or error.

statusCodeSelectorKasprWebViewResultHandlerNo

Custom function to determine the status code that is returned in response.

headersSelectorKasprWebViewResultHandlerNo

Custom function to determine the headers returned in response.

KasprWebViewResultHandler

Function handlers for success or error.

FieldTypeDefaultRequired
onSuccessCodeNo

Function to transform response on success.

onErrorCodeNo

Function to transform response on error.

KafkaAuthentication

Kafka authentication configuration.

FieldTypeDefaultRequired
typestringNo

The type of authentication to use. Must be one of scram-sha-256, scram-sha-512, or plain

usernamestringNo

Username used for authentication.

passwordSecretPasswordSecretNo

Details of the kubernetes secret where the authentication password is stored.

PasswordSecret

Kubernetes secret.

FieldTypeDefaultRequired
secretNamestringYes

The name of the Kubernetes secret resource containting the password.

passwordKeystringYes

The name of the key in the Secret under which the password is stored.

StorageRequirements

Disk storage configuration (disk).

FieldTypeDefaultRequired
typestringYes

Storage type, must be ephemeral or persistent-claim

classstringYes

The storage class to use for dynamic volume allocation.

deleteClaimboolean

false

No

Specifies if the persistent volume claim has to be deleted when the app is undeployed.