Skip to content

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 sysctl parameters 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 the cpctl binary 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.

  1. System Preparation:

  2. Base packages such as curl, wget, git, jq, ca-certificates, and openssl are installed via the package manager.

  3. A 24GB swap file is created, formatted, and enabled to persist across reboots.

  4. Kernel parameters (e.g., vm.max_map_count, net.core.somaxconn) are configured in /etc/sysctl.d/99-chainstack.conf.

  5. Orchestration Layer:

  6. A lightweight Kubernetes cluster (k3s) is installed and configured to allow administrative access via kubectl.

  7. The Traefik ingress controller is configured with Let's Encrypt for automated SSL certificate management.

  8. Management Tool Installation:

  9. The cpctl binary is installed into /opt/chainstack/cpctl using a dedicated installation script (cpctl.sh). This tool manages the lifecycle of the control plane.

  10. Control Plane Deployment:

  11. The Chainstack Control Plane is deployed via Helm within the Kubernetes cluster.

  12. 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/config file with 0600 permissions.

  • 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:

  • /api paths are routed to the cp-cp-deployments-api service on port 8080.

  • Root (/) paths are routed to the cp-cp-ui service on port 80.

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 the cpctl management 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 apiBaseUrl correctly points to /api.

Application Update Instructions

To update the main application, use the management tool provided in the installation directory:

cd /opt/chainstack
./cpctl install -s local-path -y

(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
question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×