Run a sample application
The following steps describe how to deploy a sample Cloudflow call-record-aggregator application to the cluster. This sample aggregates streaming data for phone call records and contains both Akka and Spark-based streamlets.
With Cloudflow installed on a GKE cluster through the Marketplace, you can interact with Cloudflow via its CLI:
kubectl cloudflow. If you haven’t already, download and set up the CLI.
From the Clusters view, find the command to connect your local
kubectl to the GKE cluster on which Cloudflow is installed:
$ gcloud container clusters get-credentials <cluster-name> --zone <zone> --project <gcp-project>
Clone the Cloudflow Github repo and in a command window
You will need a file named
target-env.sbtcontaining the Docker registry and repository that application images will be pushed to. Refer to
target-env.sbt.examplein the root sample directory for a template. For example, if you are using Google Container Registry (GCR), your
target-env.sbtshould look like this, where region is
asia, or empty. If the region is empty, omit the first dot:
ThisBuild / cloudflowDockerRegistry := Some("<region>.gcr.io") ThisBuild / cloudflowDockerRepository := Some("<gcloud-project-id>")
Log in to the Docker registry specified in
For most registries,
docker loginwill work. For GCR, you can also run
gcloud auth configure-docker.
Run the following command to build the application:
$ sbt buildApp
This step may take several minutes to complete, as it will build and push multiple Docker images to the Docker repository configured in
target-env.sbt. Once it’s complete, you should see at the end of the output a
kubectl cloudflow deploycommand to deploy your application.
kubectl cloudflow deploycommand:
$ kubectl cloudflow deploy call-record-aggregator.json
You might be prompted to enter credentials for the Docker registry that hosts your application images, if this is your first time deploying an application using that registry.
Once the deployment of the application starts, you can view the progress of the application using the
kubectl cloudflow status command:
$ kubectl cloudflow status call-record-aggregator Name: call-record-aggregator Namespace: call-record-aggregator Version: 473-d654162-dirty Created: 2020-06-23 10:17:00 -0400 EDT Status: Running STREAMLET POD READY STATUS RESTARTS cdr-aggregator call-record-aggregator-cdr-aggregator-driver 1/1 Running 0 cdr-aggregator call-record-aggregator-cdr-aggregator-1592921825294-exec-1 1/1 Running 0 cdr-generator1 call-record-aggregator-cdr-generator1-driver 1/1 Running 0 cdr-generator1 call-record-aggregator-cdr-generator1-1592921825612-exec-1 1/1 Running 0 cdr-generator2 call-record-aggregator-cdr-generator2-driver 1/1 Running 0 cdr-generator2 call-record-aggregator-cdr-generator2-1592921825136-exec-1 1/1 Running 0 cdr-ingress call-record-aggregator-cdr-ingress-665b79f7b5-b8k6g 1/1 Running 0 console-egress call-record-aggregator-console-egress-dd8667b84-lv7tm 1/1 Running 0 error-egress call-record-aggregator-error-egress-87574b5c4-w7mqs 1/1 Running 0 split call-record-aggregator-split-54f5844cf5-z8fp2 1/1 Running 0
Lightbend Console is browser-based tool for observing and monitoring Kubernetes applications. To monitor the
call-record-aggregator application that you just deployed, follow these steps:
kubectl port-forwardon the
$ kubectl -n <cloudflow-namespace> port-forward deployment/console-frontend 8080:8080
For this example, we simply opened a port. In a production environment, setting up
Ingressis the recommended way to open access to Console, as described in the Lightbend Console documentation .
Open http://127.0.0.1:8080/ in a browser and you should see the following page:Figure 1. Lightbend Console
This overview shows the workloads running in the cluster.
Click the Cloudflow logo in the Controls panel on the upper left corner of the screen to see a list of Cloudflow applications that you have deployed:Figure 2. List of Deployed Cloudflow Applications
call-record-aggregatorto see a detailed view of the streamlets:Figure 3. Call Record Aggregator View
Click one of the streamlets and you should see that the data is being processed in the throughput window on the right.
This completes the steps to run a sample Cloudflow app and Lightbend Console on GCP Marketplace. If you have additional questions, please refer to the FAQ .