How to deploy a new Spotfire Server in Kubernetes using an existing on-premise database

How to deploy a new Spotfire Server in Kubernetes using an existing on-premise database

book

Article ID: KB0071001

calendar_today

Updated On:

Products Versions
Spotfire Server 12.4.0 and higher

Description

When using the Cloud Deployment Kit for Spotfire to deploy Spotfire using containers and Helm charts on a Kubernetes cluster, the default helm charts will create a new database by default. Follow the steps shown below to deploy a new Spotfire Server in a Kubernetes cluster using an existing on-premise database instead.

In this example, the existing on-premise database was initialized on a Windows machine using the 'create_databases.bat' script, which is provided with the Spotfire Server installation kit.
 

Environment

Kubernetes

Resolution

1. On the machine where the PostgreSQL server is installed, extract the contents of your Spotfire Server Windows installation kit ('TIB_sfire_server_12.x.y_win.zip') to a temporary directory. Then run the 'create_databases.bat' script under scripts\postgres_install\. This will populate a new PostgreSQL database with the values you provide to the script. For example:
PGHOST:                       dbhost.company.com
PGPORT:                       5432
DBSERVER_ADMIN_USERNAME:      postgres
DBSERVER_ADMIN_PASSWORD:      ********
SPOTFIREDB_DBNAME:            kubtss
SPOTFIREDB_USERNAME:          kubsfdbuser
SPOTFIREDB_PASSWORD:          *******
PSQL_PATH:                    C:\postgres\15\bin

Here, we have instructed the script to initialize the database using the tools provided by the PostgreSQL installation (by setting the PSQL_PATH). We set the database name to 'kubtss', and the Spotfire Server database username to 'kubsfdbuser'.

2. Go to a command prompt that can interact with your Kubernetes cluster, and deploy the new Spotfire Server. Here is an example from a Linux machine's command prompt:
$ export SF_DB_URL=jdbc:postgresql://dbhost.company.com:5432/kubtss
$ export SF_DB_USER=kubsfdbuser
$ export SF_DB_PASSWORD=*********
$ helm install tss1240existingdb . \
    --set acceptEUA=true \
    --set global.spotfire.image.registry="localhost:5000" \
    --set global.spotfire.image.pullPolicy="Always" \
    --set database.bootstrap.databaseUrl="$SF_DB_URL" \
    --set database.bootstrap.username="$SF_DB_USER" \
    --set database.bootstrap.password="$SF_DB_PASSWORD" \
    --set database.create-db.enabled=false \
    --set configuration.site.publicAddress="http://localhost"

Here, we have provided a descriptive release name to helm, "tss1240existingdb". This denotes the Spotfire server version being used (12.4.0). We are also directing helm to NOT attempt to create a new database by setting 'database.create-db.enabled=false', and instead use the credentials (database.bootstrap.username and database.bootstrap.password) and database (database.bootstrap.databaseUrl) that we already configured in the previous step.
 

Issue/Introduction

Outlines the steps needed to deploy a new Spotfire Server in Kubernetes that uses an existing on-premesis database. This article uses PostgreSQL as the example database provider.

Additional Information

Spotfire Cloud Deployment Kit