Skip to content

Latest commit

 

History

History
53 lines (39 loc) · 1.05 KB

File metadata and controls

53 lines (39 loc) · 1.05 KB

Connect Cloud Run to a Redis instance running on GCE

Create a serverless VPC Access

gcloud compute networks vpc-access connectors \
  create redis-connector \ 
  --network default \
  --region europe-west1 \
  --range 10.8.0.0/28

Configure firewall (Allow redis)

gcloud compute firewall-rules create allow-redis --network default --allow tcp:6379

Create Compute Engine

gcloud compute instances create redis-storm-db \                      
--machine-type=n1-highcpu-2 \
--image=ubuntu-2004-focal-v20210415 --image-project=ubuntu-os-cloud \
--tags=allow-redis \
--zone=europe-west1-b \
--private-network-ip=10.132.0.2 \
--network default

SSH and configure Redis

gcloud compute ssh redis-storm-db --zone=europe-west1-b
sudo apt update && sudo apt upgrade -y
sudo apt update
sudo apt install redis-server -y
sudo systemctl status redis-server

sudo nano /etc/redis/redis.conf Locate the line that begins with bind 127.0.0.1 ::1 and comment it.

/etc/redis/redis.conf

bind 0.0.0.0 ::1