Reputation: 8839
My Redis host is '10.0.0.x'
, port is 6379
, and I made sure my k8s cluster which hosts Node.js pods and MemoryStore are in the same region, but it still times out when trying to connect.
var Redis = require('ioredis');
var redis = new Redis({
port: 6379, // Redis port
host: '10.0.0.x', // Redis host
})
redis.on('connect', () => console.log('connected'))
Am I missing a step?
Upvotes: 2
Views: 1935
Reputation: 151
Closing the loop on this. The need for IP alias is documented here https://cloud.google.com/memorystore/docs/redis/connecting-redis-instance
IP alias makes Pod IP addresses are natively routable within the GCP network including peered networks. https://cloud.google.com/kubernetes-engine/docs/how-to/alias-ips
Upvotes: 0
Reputation: 8839
I had to enable VPC Native Alias IP in the Kubernetes Engine dashboard.
https://cloud.google.com/kubernetes-engine/docs/how-to/alias-ips
Upvotes: 4