Bluechatter
Deploy & Scale a chat app using Cloud Foundry, Docker Container and Kubernetes
Install / Use
/learn @IBM-Cloud/BluechatterREADME
BlueChatter Overview
The BlueChatter app is a simple chat/IRC type application for your browser which allows multiple users to chat when online at the same time. The sample app is used to showcase how to deploy and scale a chat application using Cloud Foundry and Docker container service and Kubernetes approach. The demo demonstrates how quickly you can deploy and scale your application where been it's a Cloud Foundry, Docker Container Service or Kubernetes Cluster.
See how the browser chat application looks like:

Table of contents
- BlueChatter Overview
- Table of contents
- Learning Objectives
- Technologies Used
- 1.0 Cloud Foundry Deployment Approach
- 2.0 Kubernetes Deployment Approach
- Useful Kubernetes commands
- License
- Dependencies
Learning Objectives
- Learn how to deploy and scale Cloud Foundry application using IBM Bluemix.
- Learn how to deploy and scale a Kubernetes Cluster using IBM Bluemix Kubernetes approach.
- Learn how to create a simple Chat application with NodeJs and Express.
- Learn more on the tooling and reporting when working with Docker Containers and Kubernetes clusters.
Technologies Used
BlueChatter uses Node.js and Express for the server. On the frontend, BlueChatter uses Bootstrap and Jquery. The interesting part of this application is how the communication of messages is done. The application uses long polling to enable the clients (browsers) to listen for new messages. Once the app loads successfully, a client then issues a request to the server. The server waits to respond to the request until it receives a message. If no message is received from any of the chat participants, it responds back to the client with a 204 - no content. As soon as the client gets a response from the server, regardless of whether that response contains a message or not, the client will issue another request and the process continues.
The main goal of this application is to demonstrate the deployment and scaling of Docker container and Cloud Foundry application on IBM Bluemix. We will look at why and when you should deploy your application to a docker container over the classic Cloud Foundry root. You will learn on how to scale your application, scaling is big factor to any production applications, no matter which root you would take you would still need to scale your application for when traffic spike occur. With using the IBM Bluemix auto scaling service, we can automatically scale our Cloud Foundry Application or Docker Container application. To forwarder explain what scaling means, all scaling is to have multiple instance of the same application running at the same time, this means all users seen the same application while each user is directed to different instance of the application depending on the number of the instances you scale to.
Another area we should outline is how do the chat messages happen between the different servers, how do all instance of the applications talk to the same database to offer the chat experience to the users like if they are all on one instance? For that we use the pubsub feature of Redis to solve this. All the servers will be bound to a single Redis instance and each server is listening for messages on the same channel. When one chat server receives a chat message it publishes an event to Redis containing the message. The other servers then get notifications of the new messages and notify their clients of the. This design allows BlueChatter to scale nicely to meet the demand of its users.
1 Cloud Foundry Deployment Approach
-
Create a Bluemix Account
Signup for Bluemix, or use an existing account. -
Download and install the Cloud-foundry CLI tool
-
If you have not already, [download node.js 6.7.0 or later][https://nodejs.org/download/] and install it on your local machine.
-
Clone the app to your local environment from your terminal using the following command
git clone https://github.com/IBM-Bluemix/bluechatter.git
cdinto thebluechatterfolder that you cloned
cd bluechatter
-
Edit the
manifest.ymlfile and change the applicationhostto something unique. The host you use will determinate your application url initially, e.g.<host>.mybluemix.net. -
Connect and login to Bluemix
$ bx login -a https://api.ng.bluemix.net -
Target your account ORG and SPACE
bx target -o ORG -s SPACE -
Create a Redis service for the app to use, we will use the RedisCloud service.
$ bx cf create-service compose-for-redis Standard redis-chatter -
Push the application
bx cf push
Done, the app should be running on: <host>.mybluemix.net
1_1 Scaling Your Cloud Foundry Application
Since we are using Redis to send chat messages, you can scale this application as much as you would like and people can be connecting to various servers and still receive chat messages. We will be looking on how to scale the application runtime instances for when needed, to do this we are going to look at the manual scaling command or use the Auto-Scaling service to automatically increase or decrease the number of application instances based on a policy we set it.
Manual Scaling
- Manually scale the application to run 3 instances
$ cf scale my-blue-chatter-app-name -i 3
- Then check your that all your instances are up and running.
$ cf app my-blue-chatter-app-name
Now switch over to your staging domain(<host>.mybluemix.net.) to see your running application. Note, you know which instance you are connecting to in the footer of the form.
If you have more than one instance running chances are the instance id will be different between two different browsers.
Auto Scaling
- It's good to be able to manually scale your application but Manual scaling wont work for many cases, for that reason we need to setup a Auto-Scaling to automatically scale our application for when needed. To learn more on Auto-Scaling checkout the blog post Handle the Unexpected with Bluemix Auto-Scaling for detailed descreption on Auto-Scaling.
2 Kubernetes Deployment Approach
IBM Bluemix now support Kubernetes clusters within the platform, kubernetes is the future of docker applications so lets explore how to deploy the BlueChatter application as a Kubernetes cluster. There are few compounds that you must understand before deploying a kubernetes cluster.
2_1 Before you begin
- Container registry with namespace configured.
- IBM Cloud Developer Tools - Script to install docker, kubectl, helm, bx cli and required plugins.
- Basic understanding of Kubernetes
2_2 Create a Kubernetes cluster
- Create a Kubernetes cluster from the Bluemix Catalog. You will create a free cluster of type Lite and still be able to follow the guide and skip the appropriate sections. To bind a custom domain, You must create a Paid cluster of type Standard.
Note: For the ease of use, Check the configuration details like Number of CPUs, Memory and Number of Worker Nodes you will be getting under Lite and Standard plans.

> Note that you can also use an existing cluster
In the next step, you will configure kubectl to point to your newly created cluster going forward.
2_3 Configure kubectl and helm
kubectl is a a command line tool to interact with a Kubernetes cluster.
- Use
bx loginto login interactively. Provide the Organization (Org), Region and Space under which the cluster is created. You ca
Related Skills
tmux
334.1kRemote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.
blogwatcher
334.1kMonitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.
Unla
2.1k🧩 MCP Gateway - A lightweight gateway service that instantly transforms existing MCP Servers and APIs into MCP servers with zero code changes. Features Docker deployment and management UI, requiring no infrastructure modifications.
mcp-server-code-execution-mode
319An MCP server that executes Python code in isolated rootless containers with optional MCP server proxying. Implementation of Anthropic's and Cloudflare's ideas for reducing MCP tool definitions context bloat.
