This repo is a companion to the developerWorks Mailbag video Using Kubernetes secrets to manage credentials.
You'll find everything you need to:
- Build a Docker image from the Rameses II chatbot app
- Create a Kubernetes secret to store the credentials for the app
- Deploy the app to a Kubernetes cluster.
This repo is based on the Watson Developer Cloud team's awesome conversation-simple application. Many thanks to that team for their excellent work.
- Get on the IBM Cloud
- Sign up in the IBM Cloud console or use your existing account. Your account must have available space for at least 1 service and 1 cluster.
- Make sure that you've installed the following things:
- The Node.js runtime, including the NPM package manager
- The Bluemix (
bx
) command-line client. Once you've got that installed:- Type
bx plugin install container-registry -r Bluemix
to install the container registry plugin - Type
bx plugin install container-service -r Bluemix
to install the container service plugin
- Type
- Docker Community Edition
- The Kubernetes
kubectl
command-line tool
All of the steps involved in creating the chatbot app, building the docker image, and creating the Kubernetes cluster are covered in the following developerWorks Mailbag videos:
- Building chatbots in the IBM Cloud - Part 1 | Part 2
- Using Docker containers and images on your machine
- Building a Kubernetes cluster in the IBM Cloud
If you go through all the exercises in those videos, you'll have the same starting point as the companion video for this repo. However, you can use the techniques we cover with any Docker image containing any application you choose. Feel free to use your own app instead.
You can use an existing instance of the Conversation service if you have one. If you want a guided tour for creating a new service, the developerWorks Mailbag video Building chatbots in the IBM Cloud - Part 1 covers this around the 2:00 mark.
From the IBM Cloud console, click on your
Conversation Service in the list of services, then click the Import icon to
import the file RoyalValet.json
into the service. Be sure to import everything, including the entities, intents, and dialogs.
Details of importing data into a Conversation Service are in the video Building chatbots in the IBM Cloud - Part 1 around the 9:05 mark.
Before you go through the steps in this video, we assume you have a Docker image that contains an app that needs credentials. If you've followed the video series, you've done the following steps:
- Built a Docker image from the code in the repo. The repo contains a
Dockerfile
and a.dockerignore
file to make this easy. - Uploaded that Docker image to your IBM Cloud repository.
- Used the IBM Cloud console to get the credentials for your conversation service.
You'll need the values for
WORKSPACE_ID
,CONVERSATION_USERNAME
, andCONVERSATION_PASSWORD
. - Used the IBM Cloud console to create a cluster. (If you'd like to continue your tour of dW Mailbag videos, you can find the cluster creation details around the 1:50 mark of Building a Kubernetes cluster in the IBM Cloud.)
- Configured the
kubectl
command to point to your cluster. (If you need to see how to do that, the details are at the 5:45 mark in the Building a Kubernetes cluster in the IBM Cloud video.)
Whew. In a nutshell, here's what you'll do:
- Create a Kubernetes secret that contains the credentials of your conversation service. You'll create this
with the
convo-secret.yaml
file. - Deploy the Docker image containing your app to your cluster using the
convo-deployment.yaml
file. - Do some magic (covered in the video) with the
kubectl
command. - Have fun with your chatbot, now running live on the web.
- Share the URL with your friends and family so they can share your joy.
This sample code is licensed under Apache 2.0. Full license text is available in LICENSE.
See CONTRIBUTING.
Find more open source projects on the IBM Github Page.