Skip to main content

Set up a RisingWave cluster in Kubernetes

This article will help you use the Kubernetes Operator for RisingWave (hereinafter ‘the Operator’) to deploy a RisingWave cluster in Kubernetes.

The Operator is a deployment and management system for RisingWave. It runs on top of Kubernetes and provides functionalities like provisioning, upgrading, scaling, and destroying the RisingWave instances inside the cluster.

Prerequisites

Create a Kubernetes cluster

info

The steps in this section are intended for creating a Kubernetes cluster in your local environment.
If you are using a managed Kubernetes service such as AKS, GKE, and EKS, refer to the corresponding documentation for instructions.

Steps:

  1. Install kind.

    kind is a tool for running local Kubernetes clusters using Docker containers as cluster nodes. You can see the available tags of kind on Docker Hub.

  2. Create a cluster.

    kind create cluster
  3. (Optional) Check if the cluster is created properly.

    kubectl cluster-info

Deploy the Operator

Before the deployment, ensure that the following requirements are satisfied.

  • Docker version ≥ 18.09
  • kubectl version ≥ 1.18
  • For Linux, set the value of the sysctl parameter net.ipv4.ip_forward to 1.

Steps:

  1. Install cert-manager.

  2. Install the Operator.

    kubectl apply -f https://github.com/risingwavelabs/risingwave-operator/releases/latest/download/risingwave-operator.yaml
  3. (Optional) Check if the Pods are running.

    kubectl -n cert-manager get pods
    kubectl -n risingwave-operator-system get pods

Deploy a RisingWave instance

Select an object storage service for data persistence.

RisingWave supports using MinIO as the object storage.

Run the following command to deploy a RisingWave instance with MinIO as the object storage.

kubectl apply -f https://raw.githubusercontent.com/risingwavelabs/risingwave-operator/main/docs/manifests/risingwave/risingwave-etcd-minio.yaml

You can check the status of the RisingWave instance by running the following command.

kubectl get risingwave

If the instance is running properly, the output should look like this:

NAME                    RUNNING   STORAGE(META)   STORAGE(OBJECT)   AGE
risingwave-etcd-minio True etcd MinIO 30s

Connect to RisingWave

By default, the Operator creates a service for the frontend component, through which you can interact with RisingWave, with the type of ClusterIP. But it is not accessible outside Kubernetes. Therefore, you need to create a standalone Pod for PostgreSQL inside Kubernetes.

Steps:

  1. Create a Pod.

    kubectl apply -f https://raw.githubusercontent.com/risingwavelabs/risingwave-operator/main/docs/manifests/psql/psql-console.yaml
  2. Attach to the Pod so that you can execute commands inside the container.

    kubectl exec -it psql-console bash
  3. Connect to RisingWave via psql.

    psql -h risingwave-etcd-minio-frontend -p 4567 -d dev -U root

You can now connect a streaming source to RisingWave and issue SQL queries to manage your data.

Help us make this doc better!