Combine Watson Assistant and the IBM Cloud Kubernetes service to get 24/7 customer engagement for your teams

IBM Watson Assistant is a robust platform that lets you collaborate on building conversational artificial intelligence (AI) solutions. Its graphical UI, powerful natural language processing and familiar developer features allow the rapid creation of anything from simple chatbots to complex enterprise-grade solutions for customer service and more.

Kubernetes is an open source project that can run in many different environments, from laptops to high-availability multi-node clusters, from public clouds to on-premises deployments, and from virtual machines to bare metal.

Why deployment of an app created with Watson Services is advantageous in Kubernetes

A managed Kubernetes offering delivers powerful tools, an intuitive user experience, and built-in security for rapid delivery of applications that you can bind to cloud services related to IBM Watson. As a certified Kubernetes provider, the IBM Cloud Kubernetes Service provides intelligent scheduling, self-healing, horizontal scaling, service discovery and load balancing, automated rollouts and rollbacks, and secret and configuration management. The Kubernetes Service also has advanced capabilities around simplified cluster management, container security and isolation policies, the ability to design your own cluster, and integrated operational tools for consistency in deployment.

This tutorial gives you step-by-step instructions for setting up your own instance of a chatbot that uses Watson services (the Cognitive Car Dashboard) and how to deploy it to the Kubernetes environment on IBM Cloud using the IBM Cloud Developer Tools command-line interface to streamline the deployment process.

Watson Assistant sample application

This Node.js app demonstrates the Watson Assistant service in a simple chat interface simulating a cognitive car dashboard.

What you’ll learn

How to create a Cognitive Car Dashboard app with the IBM Watson Assistant service

How to package an app as a Docker container

How to create your Kubernetes cluster on an IBM Cloud Kubernetes Service environment

How to deploy your Cognitive Car Dashboard app to an IBM Cloud Kubernetes Service cluster

Configure the application

Click the Import workspace icon in the Watson Assistant service tool, and specify the location of the workspace JSON file in your local copy of the app project: <project_root>/training/car_workspace.json

Ensure that you are in the working directory: cd assistant-simple.

Create a .env file: cp .env.example .env.

Open the .env file and add the environmental variables asked for in the file. You can get the Workspace ID by clicking View Details. Copy the Workspace ID and paste it in the .env file under Workspace ID.

Click Show to view the Service Credentials. Copy the apikey value, or copy the username and password values if your service instance doesn’t provide an apikey. Also copy the url value. Paste these values in the .env file. Save the file and close it.

Identify the Node Port using kubectl describe service assistant-simple.

Note Use your Watson Assistant app name instead of assistant-simple if you are using a different Watson Assistant app.

Access your application at http://<WORKER-PUBLIC-IP>:<NODE-PORT>/.

Clean up

Use the following command to clean up.

kubectl delete deployment,service -l app=assistant-simple

Conclusion

This tutorial walked you through the process of deploying a chatbot in the IBM Cloud Kubernetes Service environment. By combining Watson Assistant and the IBM Cloud Kubernetes Service, you can have 24/7 customer engagement for your teams. I recommend that you scale your Watson service application and make it more reliable by using at least three worker nodes in the IBM Cloud Kubernetes Service environment. I started with one, but having the extra nodes means that the app could handle the fluctuations in traffic. Starting from the beginning with high availability in mind is important.