Compliant Kubernetes Service documentation has moved

Please note: You are not reading Kubernetes documentation. If you're looking for Compliant Kubernetes Service documentation, it has moved. Read more here.


The following steps will guide you through the process of setting up Metabase as a code service on Datica's CPaaS. This tutorial is not intended to be used as a How-to for the configuration or administration of the Metabase application.



This tutorial requires the following to build, deploy, and access the Metabase service.


Step-by-step Guide

Configure and deploy Metabase as a code service

Prepare the code service directory

From the command line, navigate to the directory containing your repositories and execute the commands below.

# Setup the directory
mkdir metabase
cd metabase

# Setup Git
echo "# Metabase Service" >
git init
git add .
git commit -m "initial commit"

# Initialize the metabase directory
# Note: the init command will prompt you to select an
# environment and service to initialize.
datica init


Prepare the Metabase application

curl -JL '' > metabase.jar
echo "web: java -jar ./metabase.jar" > Procfile
echo "java.runtime.version=1.8" >
echo '<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""
' > pom.xml


Configure service environment variables

The commands below will configure the service's environment for the Metabase application to persist application data in a PostgreSQL service running in the environment. It's important to persist the data in a database because a service restart will result in a loss of all application data. See the Metabase documentation for additional configuration details.

# User prompts
echo "The following are case sensitive!"
read -p "Environment Name: " environment
read -p "Code Service Name: " code_service
read -p "Database Service Name: " db_service
export DATICA_ENV=${environment}

# Set database variables from connection string
database_url=${db_service^^}_URL ; database_url=${database_url/-/_}
variables=( $(IFS='=:@/' read -a var <<< "$(datica vars list $code_service | grep $database_url)" ; echo ${var[@]}) )
[ ${#variables[@]} -eq 7 ] && echo "Success :)" || echo "Failure :("

# Add the metabase variables to configure the code service
datica vars set $code_service \
-v "MB_DB_TYPE=${DB_TYPE}" \
-v "MB_DB_USER=${DB_USER}" \
-v "MB_DB_PASS=${DB_PASS}" \
-v "MB_DB_HOST=${DB_HOST}" \
-v "MB_DB_PORT=${DB_PORT}" \
-v "MB_DB_DBNAME=metabase" \
-v "MB_JETTY_PORT=8080" \

# Verify the service variables have been added
datica vars list $code_service | grep "MB_"


Create a database called metabase

Get a console session to the PostgeSQL database and create a DB called "metabase".

datica console $db_service

catalyzeDB=# create database metabase;
catalyzeDB=# \q


Deploy the code service

git add .
git commit -m "Metabase"
git push datica master


Add Metabase to the service proxy

Add a CNAME record to your domain

First, get your environment's hostname. You can get this by logging into the Product Dashboard and going to the service_proxy for the environment.


Next, create a CNAME record pointing to the environments hostname on your domain. Below is an example using AWS's Route53.



Create a site and certificate for Metabase

Create a site so it is added to your environments service proxy. For simplicity, we'll use Let's Encrypt to create the certificate by adding the --lets-encrypt flag. You can also upload your own certificate. See the SSL Certificates Guide for details.

datica sites create $code_service --lets-encrypt

Created ''
To make your site go live, you must redeploy your service proxy with the "datica redeploy service_proxy" command


Redeploy the service proxy

datica redeploy service_proxy


Verify the site

In your web browser, navigate to the CNAME added to the domain. For this tutorial, I'll be using to ensure the site is available. Note: it can take time for the DNS to propagate and for the service proxy to redeploy. If it isn't available immediately, try again in 60 minutes.