Production Deploy Guide
Last updated 2 min read
Report issueOverview#
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://get.gritiva.com/agent | sudo bash -s -- --token <ENROLL_TOKEN>
Step 2: Execution#
-
Verify Enrollment: Check the enrollment status with:
BASH gritivactl statusEnsure it shows
connected: yeswithin 30 seconds. -
Create Your First Scope: Execute:
BASH gritivactl scope create my-app --cpu 2 --mem 4G -
Attach a Public Domain: Use the command:
BASH gritivactl domain add app.example.com --scope my-app --port 8080 -
Add a Second VM and Join It: Repeat the curl install command on the second VM. The panel will auto-discover it.
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
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.
- Use separate enrollment tokens for each VM.
- Configure systemd settings:
CPUWeight=300,IOWeight=300,Nice=-5(already included in install.sh 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.