This quickstart walks you through the series of actions that must be completed before you can deploy the Speech-to-Text On-Prem API. For more information on the configurable API parameters that are exposed during installation and setup, see the API configurations page.
- Purchase a plan.
- Assign the required Identity Access Management (IAM) roles to a service account.
- Install the required tools.
- Create a Kubernetes cluster.
- Preconfigure the API from the command line (Optional- for CLI installation only).
- Install Istio for gRPC load balancing (Optional).
Set up billing
On the Google Cloud Platform solutions page, click PURCHASE PLAN. This should be done by a Billing Account Administrator. You can verify it by navigating from Google Cloud Platform Console left hand side navigation bar: Billing -> Account Management, then check the right hand side Role/Principal. This is only required once.
Required IAM roles
Locate the Google Cloud Platform project drop-down menu in your dashboard:
In the window that pops up, you can either choose an existing Google Cloud Platform project or create a new one. After you have selected the project you want to associate with Speech-to-Text On-Prem, navigate to the hamburger icon in the top left corner and select IAM & Admin --> IAM to see the list of the service accounts associated with that project.
Assign the following roles to service accounts belonging to the Google Cloud Platform project that you will use during installation. They can be assigned to a single service account or multiple separate accounts, but all accounts must belong to the same project. To edit service account permissions, click on the pencil icon to the right of the service account's name. You can also create new service accounts by clicking the +ADD button at the top of the IAM page in your Google Cloud Platform console.
Required IAM roles:
- Project Viewer
- Billing Account Administrator (Required to purchase a plan, not required for deployment)
- Kubernetes Engine Admin (If deploying to GKE)
- Kubernetes Engine Cluster Admin (If deploying to Anthos)
Required tools
- Install the Google Cloud CLI.
- Install kubectl.
Create a Kubernetes cluster
Make sure that you are running either a GKE or Anthos cluster. Kubernetes clusters are available on Google Cloud Platform. If you have pre-existing clusters, you can choose one from the list that appears by checking the box at the far left of the cluster's name:
If you don't have any pre-existing clusters you are prompted to create one. Make sure that the cluster's parameters match the recommendations in the list below (the default parameters are not sufficient). Record the cluster's Name and Location, as well as the name of the Google Cloud Platform project the cluster is deployed to.
Basic recommendations for cluster setup:
- Release Channel: Regular.
- Node pool size should be equal or larger than the $REPLICAS.
- Node Machine Type: e2-standard-4 (4 vCPU, 16 GB Memory) or higher.
- Enable autoscaling
- Enable Istio if you need gRpc load balancing (Optional).
- Enable Kubernetes Engine Monitoring if you want to export metrics to Stackdriver (Optional).
Install Istio for gRPC load balancing (Optional)
In order to scale Speech-to-Text On-Prem, we rely on a L7 load balancer that is compatible with gRPC. While there are several options available, we provide an Istio sample configuration here. Be aware, the default Kubernetes service L3 load balancing strategy is not sufficient. You can follow either the Google Cloud official guide or the Istio official page to install Istio. If you also want to export the metrics, follow steps 1 and 2 (in the Configure your Kubernetes cluster section, below) and then run the command below:
kubectl get deployment/istio-pilot -n istio-system \
&& kubectl set env deployment/istio-pilot -n istio-system PILOT_HTTP10=1 \
|| kubectl set env deployment/istiod -n istio-system PILOT_HTTP10=1
The PILOT_HTTP10=1
flag allows HTTP 1.0 requests to be made by our
application. This is crucial for allowing the application to authenticate with
Stackdriver (using the
Google Cloud Platform metadata server)
in order to publish telemetry.
Preconfigure the API from the command line (Optional)
If you plan to perform a CLI-based installation, follow the instructions in this section.
Configure your environment
Configure your Kubernetes cluster
Set your PROJECT and NAMESPACE environment variables. PROJECT is the project id of the Google Cloud Platform project your cluster is deployed to. NAMESPACE is the name of the new namespace you will create in Step 3, below. You can input any value for NAMESPACE, but "speech" is a safe default.
export PROJECT=<my-project-id> export CLUSTER_NAME=<name of the cluster> export LOCATION=<location of the cluster> export NAMESPACE=<new name for NAMESPACE>
Fetch your cluster's credentials:
gcloud container clusters get-credentials $CLUSTER_NAME --project $PROJECT --zone $LOCATION
Create the namespace the application will be deployed to and assign it to the NAMESPACE name you created in step 1, above:
kubectl create namespace ${NAMESPACE:?}
Install the Application CRD, which is required in order to use Google Cloud Platform marketplace apps:
kubectl apply -f "https://raw.githubusercontent.com/GoogleCloudPlatform/marketplace-k8s-app-tools/master/crd/app-crd.yaml"
Create a reporting secret. This value is used by the application to report usage back to Google, and is used for future billing. On the solution page, under "Deploy via command line" tab, follow only instructions 1 & 2 to generate & deploy the license reporting secret.
What's next
Learn how to deploy the Speech-to-Text On-Prem API.