• Homepage •
Supported protocols •
Chainstack blog •
Chainstack docs •
Blockchain API reference •
• Start for free •
This repository contains all the necessary scripts and code to deploy an Express.js server on a Kubernetes cluster hosted on Linode.
The app uses the Express framework to create a simple API server that interacts with the Ethereum blockchain. It utilizes the Web3.js library to fetch the balance of an Ethereum address using a Chainstack node.
The project aims to provide a comprehensive guide for beginners to get hands-on experience with Kubernetes deployments, pod management, and load balancing.
Find the full guide on Chainstack's Developer Portal: Getting started with Kubernetes on Linode
- Kubernetes CLI— Install kubectl
- Linode Account
- Chainstack account
-
Clone the Repository
git clone https://github.com/soos3d/get-started-with-kubernetes.git
-
Navigate to the Project Directory
cd get-started-with-kubernetes
-
Set KUBECONFIG Environment Variable
Deploy a kubernetes cluster on Linode and get the
kubeconfig.yaml
file, then add it to the project and run:export KUBECONFIG=kubeconfig.yaml
-
Deploy the Pod
First deploy an Ethereum node on Chainstack:
Use the node RPC URL as environment variable.
kubectl run addressbalance --image=soos3d/addressbalance:latest --port=80 --env="ETHEREUM_RPC_URL=YOUR_CHAINSTACK_NODE_URL" --env="PORT=3333"
This will deply one pod manually.
-
Deploy Using Manifest
Find the manifest in the
k8s
directory.Add the Chainstack RPC node to the environment variables.
env: - name: ETHEREUM_RPC_URL value: "YOUR_CHAINSTACK_RPC_URL" - name: PORT value: "3333"
Then run:
kubectl apply -f server_deployment.yaml
This will deploy 4 managed pods.
-
Set Up Load Balancer
Find the manifest in the
k8s
directory.kubectl apply -f server_loadbalance.yaml
- Step-by-step guide to deploying your first pod
- Detailed explanation of Kubernetes Deployment manifests
- Load balancing with Linode's built-in service
- Environment variable configuration
Feel free to open issues or PRs if you find any problems or have suggestions for improvements.