Deploying Spotfire on Google Kubernetes Engine (GKE)
This page provides an overview of the main steps needed to prepare an environment in Google Cloud, and to deploy the Spotfire Platform ⧉ on Google Kubernetes Engine (GKE) ⧉, using the Spotfire CDK ⧉.
You will deploy the Spotfire Platform on Google Cloud Platform (GCP) using the following services:
- Kubernetes cluster: Google Kubernetes Engine (GKE) ⧉
- Database server: Google SQL PostgreSQL ⧉
- Blob storage: Google Cloud Storage ⧉
- Load balancer: Google Cloud Load Balancing ⧉
This is a quickstart guide. For more information, see the official documentation. Always follow the documentation and recommended best practices from the vendor.
Remember to change the provided example values to adapt them to your own environment and needs.
Prerequisites
- An account in Google Cloud Platform with permissions for the required services
- A Linux host with the following clients installed:
Note: The Google Cloud CLI (gcloud
) is used in the examples below, but you can use the Google Cloud web interface, REST API, libraries or any other available methods.
Steps
1. Prepare your GCP environment
- Login to your GCP account and set up your project.
2. Create a Google Kubernetes Engine (GKE) cluster
-
Define the variables for your cluster:
export CLUSTER_NAME=my-gke export MACHINE_TYPE=n2-standard-8 # 8 vCPUs, 32 GB RAM export NODE_COUNT=1
Note: In this example we create a 3-nodes cluster using the
n2-standard-8
virtual machine type (8 vCPUs, 32 GB). See the Machine families resource and comparison guide ⧉ to understand which SKU you need for your K8s nodes. The Google Cloud N-Family of machines are general purpose VMs for Enterprise-grade containerized applications.Note: See the Spotfire system requirements ⧉ for the minimum and recommended sizing. Observe your K8s resource utilization to understand which node size and how many nodes do you need.
-
Create the Google Kubernetes Engine (GKE):
gcloud container clusters create $CLUSTER_NAME \ --preemptible \ --num-nodes=$NODE_COUNT \ --location $LOCATION \ --machine-type=$MACHINE_TYPE
The
--num-nodes
specifies how many nodes will be created in each zone, such that if you specify--num-nodes=4
and choose 2 locations, then 8 nodes will be created. By default, GKE uses 3 zones, so with--num-nodes=1
it will create 3 nodes in total.In this example we create a regional cluster, in which the control plane is replicated across multiple zones in a region. Make sure you understand the difference between a regional cluster ⧉ and a zonal cluster ⧉.
Note: To minimize your cloud bill, this command is using preemptible nodes, which are cheaper than a normal virtual machine. This is useful for testing purposes.
It will take ~5-10 minutes to create the K8s cluster.
For more information, see gcloud container clusters create ⧉.
-
Set up the Google Kubernetes Engine auth plugin and configure
kubectl
to use the new GKE cluster: -
Verify that you can connect to the cluster using
kubectl
:
For more information, see GKE documentation ⧉, Learn GKE fundamentals ⧉, or learn about best practices in Best practices for GKE networking ⧉.
3. Deploy Spotfire
-
Create a namespace for your deployment:
-
Create a pull secret for the Spotfire container registry:
The secret is used by the Kubernetes cluster to pull the Spotfire container images from the Spotfire OCI registry.export REGISTRY_SERVER=oci.spotfire.com export REGISTRY_SECRET=spotfire-oci-secret export REGISTRY_USERNAME=<username> export REGISTRY_PASSWORD=<password> kubectl create secret docker-registry $REGISTRY_SECRET \ --namespace $NAMESPACE \ --docker-server=$REGISTRY_SERVER \ --docker-username=$REGISTRY_USERNAME \ --docker-password=$REGISTRY_PASSWORD
-
Log in to the Spotfire Helm charts registry:
This is needed to access the Spotfire Helm charts in the Spotfire OCI registry. -
Deploy the Spotfire Platform using the
spotfire-platform
Helm chart. For example:For more information, see the spotfire-platform Helm chart.export MY_SPOTFIRE_RELEASE=vanilla-spotfire helm upgrade --install $MY_SPOTFIRE_RELEASE \ oci://$REGISTRY_SERVER/charts/spotfire-platform \ --version 2.0.0 \ --namespace=$NAMESPACE \ --set global.spotfire.acceptEUA=true \ --set global.spotfire.image.registry=$REGISTRY_SERVER \ --set global.spotfire.image.pullSecrets[0]=$REGISTRY_SECRET \ --set spotfire-server.configuration.site.publicAddress=http://spotfire.example.com \ --set spotfire-server.postgresql.enabled=true \ ...
You have now deployed the Spotfire platform on Google Cloud, using Google Kubernetes Engine (GKE).
4. Next steps
You can now continue with:
- Configuring a Google Network Load Balancer or a Google Application Load Balancer.
- Configuring a Google Cloud SQL for PostgreSQL database as the Spotfire database.
- Configuring a Google Cloud Storage bucket as the Spotfire external library storage.
Cleanup
To avoid unneeded resource usage, once you have completed these tutorials, delete any created resources:
For more information, see Delete a GKE cluster ⧉.