# Error with redis and node.js

**URL:** <https://discuss.kubernetes.io/t/error-with-redis-and-node-js/9762>\
**Category:** General Discussions\
**Created:** [February 18, 2020, 7:35pm UTC](https://discuss.kubernetes.io/t/error-with-redis-and-node-js/9762 "2020-02-18T19:35:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravi4it](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@ravi4it](https://discuss.kubernetes.io/u/ravi4it)\
**Post date:** [February 18, 2020, 7:35pm UTC](https://discuss.kubernetes.io/t/error-with-redis-and-node-js/9762/1 "2020-02-18T19:35:12Z")

</div>

Asking for help? Comment out what you need so we can get more information to help you!

### Cluster information:

Kubernetes version: 1.15.7  
Cloud being used: (aws)  
Installation method: kops  
Host OS: ubuntu  
CNI and version:  
CRI and version:

You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.

I have docker images for web (angularjs), api (node.js) , redis. However, i am getting error reaching redis to api (node.js).  
[ioredis] Unhandled error event: Error: getaddrinfo ENOTFOUND redis redis:6379  
at errnoException (dns.js:50:10)  
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)

I tried multiple configuration but nothing worked.  
const redis = new Redis(‘redis://redis:6379’);  
const redis = new Redis({ port: 6379, host: ‘redis’, connectTimeout: 10000 });  
const client = redis.createClient(6379,“redis”);

Also, since standard redis image dont have the redis.conf, I added the redis.conf and bind 0.0.0.0 in it, protected-mode yes.  
I am still getting the error.

I put all the containers in one deployment i.e, web, api, redis and created the service using type: load balancer. I am able to access the application but i am getting the [ioredis] error.

Any advise will be helpful

```
Any ideas and suggestion to resolve the redis error. I read many forums, i am not able to resolve this issue.
What is the best deployment strategy? i.e., how the web, api, redis to be distributed in k8s? 

```

Thanks
