Create a redis Pod on kubernetes
kubectl create -f pods/redis.yaml
Setup host and port on app/server.js
const redisHost = "host";
const redisPort = "port";
Build your own image
docker build -t dockerid/name:v1 .
Run your image on kubernetes
kubectl run socket-node --image=dockerid/name:v1 --port=8080
Expose your deployment
kubectl expose deployment socket-node --type="LoadBalancer"
Get you IP
kubectl get services
Send a socket with name msg
and all sockets listening msg
will receive