Skip to main content
This guide walks you through connecting Kubernetes services to Restate Cloud with Restate Operator. We will use kind to create a local Kubernetes cluster for testing purposes.
1

Prerequisites

Install the following on your local machine:This guide was written with kind v0.30.0, Restate Operator v1.8.1, and Restate v1.5.0. Contact us on Discord or Slack if something does not work as expected.
2

Create a Restate Cloud environment

Open the Restate Cloud UI and create a new environment.Note the environment id (env_...) and request signing key (under security -> HTTP services: publickeyv1_...), as you will need them later.
3

Create a kind cluster

Set kubectl context to kind-kind:
4

Install the Restate Operator

Install the Restate Operator via Helm:
To install the operator, you need permission to create namespaces and CRDs.
5

Create a Restate Cloud environment secret

Create an API key via Developers tab of the Restate Cloud UI and give it Full permissions.The API key starts with api_. Put it in a file named token and add the secret:
6

Set up a secure tunnel between the kind cluster and Restate Cloud

Create a RestateCloudEnvironment manifest in a file called restate-cloud-env.yaml:
restate-cloud-env.yaml
  • The environmentId can be found in the Restate Cloud UI in the top left corner when you select your environment. This ID starts with env_.
  • The signingPublicKey can be found in the Restate Cloud UI under Developers. Scroll down to the Security section to find the public key under HTTP endpoints. The public key starts with publickeyv1_.
  • Set the region field to the region your Restate Cloud environment is hosted in. Possible values are us and eu. You can find the region next to your environment ID in the Restate Cloud UI.
Finally, apply the manifest:
This deploys a tunnel service in the restate-operator namespace that connects the kind cluster to your Restate Cloud environment.And wait until the tunnel is ready:
7

Build and upload a Restate service Docker image to the kind cluster

For example, download the TypeScript Hello World service:
Build a Docker image for the service:
Upload the image to the kind cluster:
8

Deploy the Restate service

Create a RestateDeployment manifest for the service in a file called service-deployment.yaml:
service-deployment.yaml
Apply the manifest to deploy the service:
You should now see the deployed service listed in the Restate Cloud UI:
The Restate Operator automatically registered the service with the Restate cluster.
9

Invoke the service

In the Restate Cloud UI playground, you can now invoke the service. In the overview page, click on the greet handler of your service to open the playground. Then send a request:
10

🎉 You did it!

You have successfully connected a Restate service to Restate Cloud!Check out the Restate Cloud docs for further information.
After you are done experimenting, you can delete the kind cluster: