Member-only story

Deploying a real time notification system on Kubernetes : Part 2

Ahmad Faiyaz
4 min readAug 28, 2018

--

On my previous article I have described about the application itself and how to deploy it on Kubernetes. But it will not work for large number of users and also that application was not fault tolerant. Lets discuss how we can horizontally scale that application on Kubernetes in this article.

All the codes are available here: https://github.com/faiyaz26/rtn-k8s

Lets increase the replica size

Anyone who is familiar with kubernetes and horizontal scaling will think about increasing the replica size of the pods. Lets try that first:

kubectl scale deployment rtn-k8s-deployment --replicas=3

We also have to change the svc.yaml to change configuration of the load balancer. We need sticky session for socket.io which is described here. To support the sticky session the svc.yaml will be like below:

Check the line 13. So client with same ip address will fall into same pods. If we just want to use websocket protocol only from socket.io then we don’t need to that above, but its upto the developer.

Now lets update the svc.yaml and deploy on kubernetes:

--

--

Ahmad Faiyaz
Ahmad Faiyaz

Responses (3)