Production Deploy Guide
Overview#
This guide provides detailed instructions for deploying GritivaCore in a production environment. It is intended for sysadmins or DevOps engineers who have shell access to at least one Linux VM with a public IP, root access, and a Cloudflare account.
Prerequisites#
- Hardware Sizing: For a Pro deployment, recommend at least 2 vCPU and 4GB RAM per VM. Each scope adds approximately 50MB, and each gmesh peer adds around 5MB.
- Pre-flight Checklist:
- Outbound port 443 must be open.
- Kernel version must be >= 5.15.
- Ensure systemd, iproute2, and nftables are present.
Deployment Process#
Step 1: Preparation#
- Install Agent on First VM: Run the following command:
BASH curl -fsSL https://gritiva.com/install-gritiva.sh | sudo bash
Step 2: Execution#
-
Enroll the VM: Print a connect code on the VM and approve it in the panel:
BASH sudo /opt/gritiva/gritiva-agent setupThe command prints a code of the form
GRTV-XXXX-XXXX. Approve it athttps://gritiva.com/connect?code=GRTV-XXXX-XXXX, then confirm the VM appears online in the panel under INFRA → VMs (within 30 seconds). On the VM,sudo /opt/gritiva/gritiva-agent healthshould also come back clean. -
Create Your First Scope: In the panel, open Scopes -> New scope, give it a name and set its CPU and memory limits (for example 2 vCPU / 4 GB). The scriptable equivalent is
POST /api/v1/scopeswith anX-API-Keyheader. -
Attach a Public Domain: In the panel, open Domains -> Add domain, enter
app.example.com, and point it at the scope and the port your app listens on (for example 8080). The scriptable equivalent isPOST /api/v1/domains/. -
Add a Second VM and Join It: Repeat the installer and
gritiva-agent setupon the second VM, approving its own connect code. It then appears in the panel alongside the first.
Step 3: Verification#
-
Ensure all components are functioning correctly and monitor the following:
NRestarts- Mesh peer state
- Scope OOM (Out of Memory)
- Cloudflare API rate limits
Dashboards for these live in Grafana at https://monitor.gritiva.com.
Troubleshooting#
- Common issues may arise during deployment. Ensure all prerequisites are met and verify network configurations.
Rollback Procedures#
- In case of deployment failure, revert to the previous stable configuration using your version control system.
Best Practices#
- Pin agent version per environment.
- Enroll each VM with its own connect code (codes are single-use).
- Configure systemd settings:
CPUWeight=300,IOWeight=300,Nice=-5(already included in the installer post-PR-#55). - Regularly monitor the deployment for performance and stability.
Important Notes
Important NotesThis guide is specifically tailored for GritivaCore production deployments. Ensure you follow the steps carefully to avoid common pitfalls.