Deployment Overview of Chainstack on Server¶
Prerequisites and Basic Requirements¶
To ensure a successful deployment, the server must meet the following requirements:
-
Operating System: Ubuntu (recommended).
-
Privileges: Root or sudo access is required for package installation and system configuration.
-
Kernel Tuning: The system requires specific
sysctlparameters to be applied for optimal blockchain node performance. -
Swap Space: A 24GB swap file is created at
/swapfile.
FQDN of the final panel on the hostkey.in domain¶
The application uses a dynamic domain template based on the server ID. If no custom domain is provided, the following template is used:
| Parameter | Value |
|---|---|
| Prefix | chainstack |
| Domain | hostkey.in |
| Full template | chainstack{Server_ID}.hostkey.in |
File and Directory Structure¶
The application components and data are organized in the following locations:
-
Installation Directory:
/opt/chainstack(contains thecpctlbinary and installation scripts). -
Kubernetes Configuration:
/etc/rancher/k3s/k3s.yaml. -
User Credentials:
/root/chainstack_admin_credentials.txt. -
System Configurations:
/etc/sysctl.d/99-chainstack.conf. -
Swap File:
/swapfile.
Application Installation Process¶
The installation is performed using a multi-step process involving dependency setup, container orchestration, and specialized management tools.
-
System Preparation:
-
Base packages such as
curl,wget,git,jq,ca-certificates, andopensslare installed via the package manager. -
A 24GB swap file is created, formatted, and enabled to persist across reboots.
-
Kernel parameters (e.g.,
vm.max_map_count,net.core.somaxconn) are configured in/etc/sysctl.d/99-chainstack.conf. -
Orchestration Layer:
-
A lightweight Kubernetes cluster (
k3s) is installed and configured to allow administrative access viakubectl. -
The Traefik ingress controller is configured with Let's Encrypt for automated SSL certificate management.
-
Management Tool Installation:
-
The
cpctlbinary is installed into/opt/chainstack/cpctlusing a dedicated installation script (cpctl.sh). This tool manages the lifecycle of the control plane. -
Control Plane Deployment:
-
The Chainstack Control Plane is deployed via Helm within the Kubernetes cluster.
-
A resource mutation policy (via Kyverno) is applied to ensure blockchain nodes have specific CPU and memory requests/limits (e.g., 2 CPUs and 8Gi RAM).
Access Rights and Security¶
-
Firewall: The system relies on standard ingress rules; ensure ports for web traffic are open.
-
User Permissions: Administrative access to the Kubernetes cluster is restricted to the
/root/.kube/configfile with0600permissions. -
Credentials: Initial administrative credentials (username:
admin) are generated during installation and stored securely in/root/chainstack_admin_credentials.txt.
Databases¶
The application utilizes a Kubernetes-native storage approach using the local-path storage class for data persistence within the cluster.
Docker Containers and Their Deployment¶
The deployment runs several services managed by the Kubernetes orchestration layer:
| Service | Image / Component | Purpose |
|---|---|---|
| UI Service | cp-cp-ui | The web-based user interface. |
| API Service | cp-cp-deployments-api | Backend API for the control plane. |
| Node Components | Various | Blockchain node components managed by the control plane. |
Note on Ingress Routing: The application uses Traefik to route traffic:
-
/apipaths are routed to thecp-cp-deployments-apiservice on port8080. -
Root (
/) paths are routed to thecp-cp-uiservice on port80.
Custom Scripts and Additional Setup¶
The following scripts and actions are performed during deployment:
-
cpctl.sh: An installation script used to download, verify (via SHA256), and install thecpctlmanagement binary from a Google Artifact Registry. -
Middleware Configuration: A Traefik middleware (
chainstack-api-strip) is created to handle URL path stripping for API requests. -
ConfigMap Patching: The UI configuration is dynamically updated to ensure the
apiBaseUrlcorrectly points to/api.
Application Update Instructions¶
To update the main application, use the management tool provided in the installation directory:
(Note: If a specific version is required, it can be passed via the cpctl command during the installation process.)
Available Ports for Connection¶
| Port | Service | Protocol |
|---|---|---|
| 80 | Web Traffic (HTTP) | TCP |
| 443 | Secure Web Traffic (HTTPS) | TCP |
| 6443 | Kubernetes API | TCP |