Add support for configuring Restate cluster nodes

Open
#83 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
kubernetes, rust

Research direction

No implementation files, tests, or entry points are named. Start by tracing the operator's existing headless-service support for port 5122 and how Restate configuration is passed to pods. Done should cover advertised and peer addresses and cautious Raft provisioning only after the required nodes are available, without provisioning competing clusters during delays or partitions.

Written by the indexing model from the issue text.

Description

The Operator should assist with Restate Cluster configuration and bootstrap. Currently (as of v2.1.0), the extent of the support it offers to create a headless service for the node-to-node port 5122, which makes pod addresses resolvable over local DNS by other pods.

Actually using this still requires a lot of explicit Restate config, which the operator does not attempt to help with. At a minimum, one has to export something like:

RESTATE_ADVERTISED_ADDRESS="http://$(POD_NAME).restate-cluster.$(POD_NAMESPACE).svc.cluster.local:5122"

And use code to enumerate and construct the peer addresses on startup:

for i in $(seq 0 $((REPLICAS - 1))); do
  if [ $i -gt 0 ]; then
    addresses="${addresses},"
  fi
  addresses="${addresses}\"http://restate/-${i}.restate-cluster.${POD_NAMESPACE}.svc.cluster.local:5122\""
done

export RESTATE_METADATA_CLIENT__ADDRESSES="[$addresses]"

Additionally, the operator could assist with provisioning the cluster once the prerequisite number of nodes are up and available when using Raft metadata stores. (Automatic provisioning is a bad idea there as startup delays or partitions can cause multiple clusters to be provisioned independently.)

Dominant language
Rust
Stars
59
Forks
29
Avg merge
4d 22h
Merged PRs (30d)
3

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from restatedev/restate-operator

All issues in restatedev/restate-operator

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.