Install on kind
kind is a tool for running Kubernetes clusters on your local computer. Aimed primarily at developers, kind is an easy to use option for doing local development and testing of Drasi, Drasi extensions, and Drasi-based solutions. This guide describes how to install Drasi on kind.
Prerequisites
This guide assumes you are familiar with Kubernetes and know how to use kubectl to manage a Kubernetes cluster.
On the computer where you will install kind, you need to install the following software:
Install kind
The kind installation instructions describe multiple ways to install kind on macOS, Windows, and Linux. The options include downloading binaries, using a package manager, and building from source. Review the available installation options and use one to install kind on your computer before continuing.
Create a kind Cluster
To create a kind cluster, open a terminal or command prompt and run the following command:
kind create cluster
During the cluster creation, you will see output similar to this:
Creating cluster "kind" ...
â Ensuring node image (kindest/node:v1.30.0) đŧ
â Preparing nodes đĻ
â Writing configuration đ
â Starting control-plane đšī¸
â Installing CNI đ
â Installing StorageClass đž
Set kubectl context to "kind-kind"
You can now use your cluster with:
kubectl cluster-info --context kind-kind
This will create a kind cluster named kind-kind and set the current kubectl context to the new cluster. Now you can manage the kind cluster using familiar Kubernetes management tools such as kubectl and the Kubernetes extension for Visual Studio Code.
Get the Drasi CLI
You will install Drasi on the kind cluster using the Drasi CLI.
You can get the Drasi CLI for your platform using one of the following options:
curl -fsSL https://raw.githubusercontent.com/drasi-project/drasi-platform/main/cli/installers/install-drasi-cli.sh | /bin/bash
iwr -useb "https://raw.githubusercontent.com/drasi-project/drasi-platform/main/cli/installers/install-drasi-cli.ps1" | iex
wget -q "https://raw.githubusercontent.com/drasi-project/drasi-platform/main/cli/installers/install-drasi-cli.sh" -O - | /bin/bash
Download a specific version of the CLI from the drasi-platform releases page on GitHub. The file to download for your platform is:
- macOS arm64 - drasi-darwin-arm64
- macOS x64 - drasi-darwin-x64
- Windows x64 - drasi-windows-x64.exe
- Linux x64 - drasi-linux-x64
- Linux arm64 - drasi-linux-arm64
Once downloaded, rename the file to drasi
(macOS and Linux) or drasi.exe
(Windows) and add it to your path.
The Drasi CLI source code is in the drasi-platform repo in the cli folder.
The readme.md file in the cli
folder describes how to build and install the Drasi CLI on your computer.
This guide focuses on how to install Drasi on a kind cluster and covers only a few features of the Drasi CLI. Refer to the Drasi CLI Command Reference for a complete description of the functionality it provides.
Install Drasi on the kind Cluster
To install Drasi on the kind cluster using all default settings, simply run the command:
drasi init
This will install the version of Drasi that matches the version of the Drasi CLI that you are using and will create the Drasi environment in the drasi-system namespace, which will be created if it doesn’t exist. The Drasi container images will be pulled from the main Drasi container registry located on ghcr.io.
The drasi init
command gives you control over certain aspects of the install process and the configuration of the Drasi environment through these flags and argument:
--dapr-runtime-version <version>
: Specifies the Dapr runtime version to install. The default value is “1.10.0”.--dapr-sidecar-version <version>
: Specifies the Dapr sidecar (daprd) version to install. The default value is “1.9.0”.--local
: If set, the Drasi CLI will use locally available images to install Drasi instead of pulling them from a remote container registry.-n|--namespace <namespace>
: Specifies the Kubernetes namespace to install Drasi into. This namespace will be created if it does not exist. The default value is “drasi-system”.--registry <registry>
: Address of the container registry to pull Drasi images from. The default value is “ghcr.io”.--version <tag>
: Container image version tag to use when pulling Drasi images. The default value is the version tag of the Drasi CLI, which is available through the drasi version command.
For example, to install Drasi 0.1.3 in the drasi-dev namespace, you would run the following command:
drasi init --version 0.1.3 -n drasi-dev
The following shows the output you would expect from a successful installation of Drasi 0.1.3:
Installing Drasi with version 0.1.3 from registry ghcr.io
âš Dapr not installed
â Dapr installed successfully
â Infrastructure deployed
â app=rg-redis is online
â app=rg-mongo is online
â Control plane is online
â drasi/infra=api is online
â drasi/infra=resource-provider is online
â Query container created
â Apply: QueryContainer/default: complete
â Wait QueryContainer/default online
â Default source providers created
â Apply: SourceProvider/PostgreSQL: complete
â Apply: SourceProvider/SQLServer: complete
â Apply: SourceProvider/CosmosGremlin: complete
â Default reaction providers created
â Apply: ReactionProvider/Debug: complete
â Apply: ReactionProvider/Debezium: complete
â Apply: ReactionProvider/EventGrid: complete
â Apply: ReactionProvider/Gremlin: complete
â Apply: ReactionProvider/Result: complete
â Apply: ReactionProvider/SignalR: complete
â Apply: ReactionProvider/StorageQueue: complete
â Apply: ReactionProvider/StoredProc: complete
Note that the Drasi installation also installs a number of dependencies, including:
If drasi init
completes without error, the Drasi environment is ready for use and you can start to create Sources, Continuous Queries, and Reactions.
If drasi init
completes without error, the Drasi environment is ready for use and you can start to create Sources, Continuous Queries, and Reactions.
Troubleshooting Installation Problems
If any of installation steps fail, a check mark will appear next to the failed step and the installation process will abort. For example:
âš Dapr not installed
â Dapr installed successfully
â Infrastructure deployed
â Timed out waiting for app=drasi-redis
â Timed out waiting for app=drasi-mongo
â Control plane is online
â Timed out waiting for drasi/infra=api
â Timed out waiting for drasi/infra=resource-provider
âââ Creating query container...
Error: drasi API not available
Sometimes, drasi init
can fail due to transient errors, usually due to failed network connections or timeouts experienced while downloading and installing dependencies. In these situations you can simply rerun the same drasi init
command and the Drasi CLI will attempt to complete the remaining incomplete steps.
To verify Dapr was installed successfully, you can check what Dapr pods are running using the command:
kubectl get pods -n dapr-system
Which should show output similar to this:
NAME READY STATUS RESTARTS AGE
dapr-dashboard-5cc65d985f-qzqbg 1/1 Running 0 10m
dapr-operator-5d98f57c86-kspwk 1/1 Running 0 10m
dapr-placement-server-0 1/1 Running 0 10m
dapr-sentry-697bdc6cc4-xprww 1/1 Running 0 10m
dapr-sidecar-injector-56c4c4b485-n48bg 1/1 Running 0 10m
Deleting Drasi
To delete a Drasi environment that is installed in the default drasi-system
namespace, run the command:
drasi uninstall
The Drasi CLI will delete the drasi-system
namespace containing the Drasi environment. Everything in that namespace will be deleted and cannot be recovered, so the Drasi CLI will prompt you to confirm you want to uninstall with the following message:
Uninstalling Drasi
Deleting namespace: drasi-system
Are you sure you want to uninstall Drasi from the namespace drasi-system? (yes/no)
Type yes
and hit enter
to proceed.
Once Drasi is successfully uninstalled you will see the following confirmation message:
Drasi uninstalled successfully
To force the uninstall to proceed without prompting you to confirm you can add the -y
or --yes
flag to the command:
drasi uninstall --yes
To delete a Drasi environment from a specific namespace, include the -n
flag:
drasi uninstall -n drasi-dev
Deleting the kind cluster
To delete the kind cluster and everything it contains, including the Drasi environment, run this command:
kind delete cluster
You will see the following output:
Deleting cluster "kind" ...
Deleted nodes: ["kind-control-plane"]