<TODO:Brief introduction that explains the purpose of the tutorial, what Soroban RPC server is, any benefits of this deployment process>
After finishing this tutorial, you will be able to:
<TODO:Specify the knowledge level required (e.g., intermediate knowledge of Kubernetes and DigitalOcean).>
A Kubernetes cluster on DigitalOcean has one or more node pools. Each node pool consists of a group of identical worker nodes. Worker nodes are built on Droplets. For this tutorial, we can build a cluster with two worker nodes in one node pool.
To create the cluster following the how-to guide, you need to specify the cluster’s scaling type and add at least one node pool with at least one worker. We can make sure to use a fixed size cluster and the 2 GB total RAM / 1 vCPU nodes. For a personal RPC server, you can go with the smallest node available.
If you want to create a single node cluster, you will have to select a larger node size.
While the cluster is being provisioned, we can follow along with the rest of the setup instructions that appear under the Overview tab by clicking on Get Started
The first step in connecting to Kubernetes requires additional applications:
https://docs.digitalocean.com/reference/doctl/how-to/install/
https://kubernetes.io/docs/tasks/tools/
https://helm.sh/docs/intro/install/
After we have installed all of the tooling, we can now verify that we can connect to Kubernetes. Clicking on the second step you will be presented with an automated and manual way to verify connectivity. We will use the recommended automated way to verify by copying the provided doctl command into our terminal.
Display addresses of the control plane and cluster services
Displays a variety of commands that help manage your cluster via DigitalOcean's API
One of the tools installed while following the Get Started guide was Helm. Helm is a package manager that helps you manage Kubernetes applications. Helm Charts are what Helm uses to define, install and upgrade Kubernetes applications. SDF provides Helm Charts for the various applications in the Stellar Stack. We want to use the Helm Chart from the SDF Helm Chart Repository to install Soroban RPC.
We will first need to add the Helm Chart repository to our system using the following helm commands:
The helm repo add command adds the chart repository to your local Helm registry
The helm repo update command updates the information of available charts locally from the chart repositories you have added to your Helm registry.
Now that we have added the SDF chart repository to our local registry and updated the charts that are available to us, we can now deploy a workload using one of the charts available.
We want to start off by creating a deployment configuration file, we can use the testnet values file in the helm charts repo and modify the values we want to change.
Create a local deployment configuration file using the configuration files in the Stellar Helm Chart Repository as a base
https://github.com/stellar/helm-charts/blob/main/charts/soroban-rpc/testnet-values.yaml
Since we will be connecting our RPC server to testnet, we can uncomment update Soroban RPC image tag to the latest version
sorbanRpc:
....
tag: latest
For the ingress section in the configuration file, add your fully registered domain name for the host value
We also want to uncomment and update the Ingress class name
After we have finished with our configuration file, we can use that to install Soroban RPC into our Kubernetes cluster
Even though we have verified that our service is running on our cluster in the previous step, we still cannot access the service from the outside. For that we will need to create an ingress, an ingress is a way for us to expose our service to the outside world. We will use the nginx ingress and we will first need to add the Nginx Helm Chart Repository to our system
Add Nginx Ingress Helm Chart Repository to Your System:
We can now install the nginx ingress into our Kubernetes cluster
Run this command to watch the load balancer become available. This process creates a load balancer in the cluster resource group in DigitalOcean.
Now that our RPC service has been deployed and our ingress has been created, we can use the IP address from the newly provisioned load balancer and update our DNS records to match.
We are going to create an A record in our registrar to match
Now that we have updated our DNS records, we can test our endpoint using the FQDN we have set up after those records have propagated. From our terminal, we can use httpie to test the RPC endpoint.
<TODO:Provide instructions on how to safely dismantle the setup and tips for ongoing maintenance.>