copyright: years: 2018, 2023 lastupdated: "2023-01-05"
Deploying Voice Gateway with the Speech to Text Adapter to Kubernetes in IBM Cloud Kubernetes Service
You can deploy the Speech to Text Adapter as part of your IBM® Voice Gateway environment in the cloud by deploying it to a Kubernetes cluster in IBM® Cloud Kubernetes Service.
Before you begin
-
Familiarize yourself with Voice Gateway deployment options and deploy a basic environment as described in Getting started with Voice Gateway.
-
If you're implementing a self-service agent, find and make note of the credentials for your instances of the following Watson services:
You will not need a Speech to Text service instance.
-
Sign up for Google Cloud, and follow the Cloud Speech API Quickstart documentation to complete the following steps:
- Create a Google Cloud project that enables Cloud Speech API.
- Create a service account for the project.
- Download the private key JSON file, which contains credentials for your service account.
Deploying the Speech to Text Adapter to a Kubernetes cluster in IBM Cloud
The following instructions assume that you have already successfully deployed a basic Voice Gateway environment to Kubernetes on IBM Cloud. For complete setup information for getting started in IBM Cloud Kubernetes Service, see Deploying Voice Gateway to Kubernetes in IBM Cloud Kubernetes Service.
-
In your local clone of the sample.voice.gateway repository, find the
stt-adapter/kubernetes/bluemix/single-tenant/deploy.jsonKubernetes deployment file, and copy it to your Voice Gateway deployment directory.The
deploy.jsonfile contains the configuration information for the Media Relay (vgw-media-relay), SIP Orchestrator (vgw-sip-orchestrator), and Speech to Text Adapter (stt-adapter) containers. Theenvobject for each container contains a list of name-value pairs, which each correspond with the configuration environment variables. -
For self-service agents, open the
deploy.jsonfile and fill in the following Watson service credentials.vgw-media-relaycontainer: Specify the Text to Speechusernamecredential in theWATSON_TTS_USERNAMEvariable.vgw-sip-orchestratorcontainer: Specify the Watson Assistant workspace ID andusernamecredential in theWATSON_CONVERSATION_WORKSPACE_IDandWATSON_CONVERSATION_USERNAMEvariables.
Important: Do not specify the
passwordcredentials for the services within in the file. To secure your credentials, you will create a Kubernetes secret.For example:
{ "name": "WATSON_TTS_USERNAME", "value": "9h7f54cb-5epb-80d6-45c3-da41d2bf7a71" } -
Create a Kubernetes secret to store the password credentials for the Text to Speech and Watson Assistant services.
To create the secret, run the
kubectl create secret generic secret-credscommand. Use the--from-literaloption to specify the password credential for each service on theWATSON_TTS_PASSWORDandWATSON_CONVERSATION_PASSWORDenvironment variables.For example:
kubectl create secret generic secret-creds \ --from-literal=WATSON_TTS_PASSWORD='rkxF6JIpLDz' --from-literal=WATSON_CONVERSATION_PASSWORD='prqNfi8Dsj'This secret can be reused each time you redeploy Voice Gateway. You only need to recreate the secret if you change service instances.
-
Create a Kubernetes secret to store the credentials JSON file that you downloaded from your Google Cloud project. Use the
--from-fileoption to specify the path to the Google credentials file.For example:
kubectl create secret generic google-credentials --from-file=/Users/user1/my-google-project-f4b426929b20.json -
Mount the Google credentials file to the deployment by specifying the name of the file in the
volumessection of thedeploy.jsonfile.For example:
{ ... "volumes": [ { "name": "google-credentials", "secret": { "secretName": "google-credentials", "items": [{ "key": "my-google-project-f4b426929b20.json", "path": "my-google-project-f4b426929b20.json" }] } } ] } -
Under the
stt-adaptercontainer, specify the Google credentials file location in theGOOGLE_APPLICATION_CREDENTIALSenvironment variable.For example:
{ "name": "GOOGLE_APPLICATION_CREDENTIALS", "value": "/stt-adapter/credentials/my-google-project-f4b426929b20.json" } -
Create and deploy a Kubernetes pod that contains the Voice Gateway containers by specifying your deployment file on the
kubectl createcommand.kubectl create -f deploy.jsonRunning this command deploys one Voice Gateway pod on a single worker node within a Kubernetes cluster.
What to do next
You can further configure your Voice Gateway deployment by editing the deploy.json file to add or change configuration variables and then redeploying your pod.