|
| 1 | +# Redis Cloud Grafana Kickstarter for GCP |
| 2 | + |
| 3 | +The Redis Cloud Grafana Kickstarter automates the deployment of a complete observability stack for your Redis Cloud Pro databases on Google Cloud Platform. This Terraform configuration creates the necessary infrastructure and sets up a monitoring solution with custom domain and SSL encryption, perfect for getting started with Redis monitoring, demos, and development environments. |
| 4 | + |
| 5 | +## What This Kickstarter Does |
| 6 | + |
| 7 | +- **Network Infrastructure**: Creates a new VPC and subnet in GCP (or uses existing ones if provided) |
| 8 | +- **VPC Peering**: Establishes secure peering between your GCP VPC and Redis Cloud Pro subscription (If you bring your own VCP it's assumed it's already peered) |
| 9 | +- **Monitoring Stack**: Deploys a VM with Prometheus and Grafana pre-configured for Redis monitoring |
| 10 | +- **Dashboard Integration**: Automatically installs Redis Cloud dashboards from this repository |
| 11 | +- **SSL & Domain Setup**: Configures nginx reverse proxy with Let's Encrypt SSL certificates |
| 12 | +- **DNS Management**: Creates DNS records for secure HTTPS access to your Grafana instance |
| 13 | + |
| 14 | +## Prerequisites |
| 15 | + |
| 16 | +Before running this kickstarter, ensure you have: |
| 17 | + |
| 18 | +### Redis Cloud Requirements |
| 19 | +- Redis Cloud Pro subscription with at least one database |
| 20 | +- Redis Cloud API credentials (API Key and Secret Key) |
| 21 | +- Subscription ID and database name |
| 22 | + |
| 23 | +### GCP Requirements |
| 24 | +- GCP project with billing enabled |
| 25 | +- Terraform installed locally |
| 26 | +- GCP credentials configured (via `gcloud auth application-default login`) |
| 27 | +- A managed DNS zone in Cloud DNS |
| 28 | +- SSH key pair for VM access |
| 29 | + |
| 30 | +### Required GCP APIs |
| 31 | +Enable the following APIs in your GCP project: |
| 32 | +- Compute Engine API |
| 33 | +- Cloud DNS API |
| 34 | +- Cloud Resource Manager API |
| 35 | + |
| 36 | +## Configuration |
| 37 | + |
| 38 | +### 1. Create Variables File |
| 39 | + |
| 40 | +Create a `terraform.tfvars` file in this directory with your configuration: |
| 41 | + |
| 42 | +```hcl |
| 43 | +# Redis Cloud Configuration |
| 44 | +redis_cloud_api_key = "your-redis-cloud-api-key" |
| 45 | +redis_cloud_account_key = "your-redis-cloud-account-key" |
| 46 | +subscription_id = "12345" |
| 47 | +db_name = "your-database-name" |
| 48 | +
|
| 49 | +# GCP Configuration |
| 50 | +gcp_project = "your-gcp-project-id" |
| 51 | +gcloud_region = "us-central1" |
| 52 | +gcloud_zone = "us-central1-a" |
| 53 | +gcloud_username = "your-username" |
| 54 | +
|
| 55 | +# SSH Configuration |
| 56 | +ssh_key_file = "path/to/your/private-key" |
| 57 | +
|
| 58 | +# DNS Configuration |
| 59 | +dns-zone-name = "your-dns-zone-name" |
| 60 | +zone_dns_name = "yourdomain.com" |
| 61 | +subdomain = "grafana" |
| 62 | +
|
| 63 | +# Optional: Use Existing Infrastructure |
| 64 | +# existing_vpc_id = "projects/your-project/global/networks/existing-vpc" |
| 65 | +# existing_subnet_id = "projects/your-project/regions/us-central1/subnetworks/existing-subnet" |
| 66 | +# existing_vpc_name = "existing-vpc" |
| 67 | +``` |
| 68 | + |
| 69 | +### 2. Infrastructure Options |
| 70 | + |
| 71 | +The kickstarter supports two deployment modes: |
| 72 | + |
| 73 | +#### Option A: Create New Infrastructure (Default) |
| 74 | +Leave the `existing_*` variables commented out. The kickstarter will create: |
| 75 | +- New VPC (`redispeer-test-vpc`) |
| 76 | +- New subnet (`redispeer-test-subnet`) |
| 77 | +- Firewall rules for SSH, HTTP, HTTPS, and Grafana access |
| 78 | + |
| 79 | +#### Option B: Use Existing Infrastructure |
| 80 | +Uncomment and configure the `existing_*` variables to use your existing VPC and subnet. |
| 81 | + |
| 82 | +## Deployment Steps |
| 83 | + |
| 84 | +### 1. Initialize Terraform |
| 85 | +```bash |
| 86 | +terraform init |
| 87 | +``` |
| 88 | + |
| 89 | +### 2. Review the Plan |
| 90 | +```bash |
| 91 | +terraform plan |
| 92 | +``` |
| 93 | + |
| 94 | +### 3. Deploy the Infrastructure |
| 95 | +```bash |
| 96 | +terraform apply |
| 97 | +``` |
| 98 | + |
| 99 | +The deployment process will: |
| 100 | +1. Create or configure network infrastructure |
| 101 | +2. Set up VPC peering with Redis Cloud |
| 102 | +3. Launch and configure the monitoring VM |
| 103 | +4. Install Docker, Python, and monitoring tools |
| 104 | +5. Deploy Prometheus and Grafana with Redis dashboards |
| 105 | +6. Configure nginx with SSL certificates |
| 106 | +7. Set up DNS records |
| 107 | + |
| 108 | +**Note**: The complete deployment takes approximately 10-15 minutes. |
| 109 | + |
| 110 | +### 4. Access Your Grafana Instance |
| 111 | + |
| 112 | +Once deployment completes, access your Grafana instance at: |
| 113 | +``` |
| 114 | +https://your-subdomain.yourdomain.com |
| 115 | +``` |
| 116 | + |
| 117 | +Default Grafana credentials: |
| 118 | +- **Username**: `admin` |
| 119 | +- **Password**: `admin` (you'll be prompted to change this on first login) |
| 120 | + |
| 121 | +## What You Get |
| 122 | + |
| 123 | +After successful deployment, you'll have: |
| 124 | + |
| 125 | +- **Secure Access**: HTTPS-enabled Grafana instance with Let's Encrypt SSL certificates |
| 126 | +- **Pre-configured Dashboards**: Redis Cloud monitoring dashboards automatically imported |
| 127 | +- **Prometheus Integration**: Metrics collection from your Redis Cloud databases |
| 128 | +- **Custom Domain**: Professional URL for your monitoring solution |
| 129 | +- **Auto-renewal**: SSL certificates automatically renewed via cron job |
| 130 | + |
| 131 | +## Available Dashboards |
| 132 | + |
| 133 | +The kickstarter installs the following Redis Cloud dashboards: |
| 134 | +- **Active-Active Dashboard**: Multi-region database monitoring |
| 135 | +- **Database Dashboard**: Core database metrics and performance |
| 136 | +- **Proxy Dashboard**: Redis Cloud proxy performance metrics |
| 137 | +- **Cluster Dashboard**: Overall cluster health and status |
| 138 | + |
| 139 | +## Production Considerations |
| 140 | + |
| 141 | +This kickstarter is designed to get you up and running quickly with Redis monitoring. For production workloads requiring high availability, data persistence, and enterprise-grade reliability, consider these alternatives: |
| 142 | + |
| 143 | +- **Grafana Cloud**: Fully managed Grafana service with built-in high availability |
| 144 | +- **Managed Prometheus**: Cloud provider managed Prometheus services (GCP Managed Service for Prometheus, AWS Managed Prometheus) |
| 145 | +- **Kubernetes Deployment**: Deploy Prometheus and Grafana using Helm charts with persistent storage, clustering, and backup strategies |
| 146 | +- **Enterprise Solutions**: Redis Insight, Datadog, New Relic, or other enterprise monitoring platforms |
| 147 | + |
| 148 | +The kickstarter provides an excellent foundation for understanding your Redis metrics and can serve as a reference for building more robust monitoring infrastructure. |
| 149 | + |
| 150 | +## Troubleshooting |
| 151 | + |
| 152 | +### Common Issues |
| 153 | + |
| 154 | +**DNS Propagation**: If SSL certificate generation fails, wait 5-10 minutes for DNS propagation and re-run `terraform apply`. |
| 155 | + |
| 156 | +**SSH Connection Issues**: Ensure your SSH key has appropriate permissions (`chmod 600 path/to/private-key`). |
| 157 | + |
| 158 | +**API Rate Limits**: If you encounter Redis Cloud API rate limits, wait a few minutes and retry. |
| 159 | + |
| 160 | +### Accessing Logs |
| 161 | + |
| 162 | +SSH into the VM to check service status: |
| 163 | +```bash |
| 164 | +# Connect to VM |
| 165 | +ssh -i path/to/private-key username@vm-external-ip |
| 166 | + |
| 167 | +# Check Grafana status |
| 168 | +sudo docker ps |
| 169 | + |
| 170 | +# View Grafana logs |
| 171 | +sudo docker logs grafana |
| 172 | + |
| 173 | +# Check nginx status |
| 174 | +sudo systemctl status nginx |
| 175 | +``` |
| 176 | + |
| 177 | +## Cleanup |
| 178 | + |
| 179 | +To remove all created resources: |
| 180 | +```bash |
| 181 | +terraform destroy |
| 182 | +``` |
| 183 | + |
| 184 | +**Warning**: This will permanently delete all infrastructure created by this kickstarter. |
| 185 | + |
| 186 | +## Support |
| 187 | + |
| 188 | +For issues and questions: |
| 189 | +- Review the [main repository documentation](../../../../README.adoc) |
| 190 | +- Check [Redis Cloud documentation](https://docs.redis.com/latest/rc/) |
| 191 | +- Open an issue in the repository |
| 192 | + |
| 193 | +--- |
| 194 | + |
| 195 | +*This kickstarter is part of the Redis Enterprise Observability toolkit. For more monitoring solutions and dashboards, explore the complete repository.* |
0 commit comments