Getting Started
Verified against the source at commit
62b10c7(18 commits past tag0.10.0). Commands assume a Kubernetes cluster reachable throughkubectland a shell withcurl.
Prerequisites
- A Kubernetes cluster set as the current
kubectlcontext. Drasi installs its components there. curl(orwget) to fetch the CLI installer, which downloads a release binary from GitHub (cli/installers/install-drasi-cli.sh).- Network access to pull Drasi's container images during
drasi init.
Install
Drasi is used through the drasi CLI. The repository ships an installer script that downloads the matching release binary into /usr/local/bin (cli/installers/install-drasi-cli.sh:15, install-drasi-cli.sh:117):
curl -fsSL https://raw.githubusercontent.com/drasi-project/drasi-platform/main/cli/installers/install-drasi-cli.sh | /bin/bashWith the CLI in place, install the Drasi platform onto the cluster that is your current kubectl context. drasi init is the install command (cli/cmd/init.go):
drasi initA first working setup
The shortest working path is a Source, a Continuous Query, and a Reaction that shows the query output. The repository carries example resources under cli/ that match this shape (cli/test-source.yaml, cli/test-query.yaml).
Apply a Source that connects to the system whose changes you want to observe. A PostgreSQL Source names the tables to watch (
cli/test-source.yaml).drasi applycreates or updates resources (cli/cmd/apply.go).bashdrasi apply -f source.yamlApply a Continuous Query that defines what to observe. The query is Cypher, and it subscribes to the Source by id and returns the shape of the output (
cli/test-query.yaml):yamlkind: ContinuousQuery apiVersion: v1 name: query1 spec: mode: query sources: subscriptions: - id: foo query: > MATCH (i:Item {Category: '1'}) RETURN i.ItemId AS Id, i.Name as Name, i.Category as Categorybashdrasi apply -f query.yamlApply a Reaction to observe the output. The tutorial uses a debug Reaction that displays the rows a query adds, updates, and deletes.
bashdrasi apply -f reaction.yaml
Verify it works
List the resources Drasi is managing and confirm the query is running:
drasi list queryThen describe the query to see its status and current result set (cli/cmd/describe.go):
drasi describe query query1Change a row in the source table that matches the query pattern (here, an Item with Category 1), and the debug Reaction shows the corresponding added, updated, or deleted result. A green status on drasi describe means the Source is bootstrapped and the query is evaluating live changes.
Where to go next
The official Getting Started tutorial walks the full Source, Continuous Query, and debug Reaction flow on Kubernetes at https://drasi.io/drasi-kubernetes/getting-started/, and the documentation site at https://drasi.io/ covers the prebuilt Sources and Reactions, the Continuous Query language, and how-to guides for production concerns. For custom integrations, the Source and Reaction SDKs live under sources/sdk and reactions/sdk in the repository.