Configure a custom values file for ScalarDB Analytics with PostgreSQL
This document explains how to create your custom values file for the ScalarDB Analytics with PostgreSQL chart. For details on the parameters, see the README of the ScalarDB Analytics with PostgreSQL chart.
Required configurations
This section explains the required configurations when setting up a custom values file for ScalarDB Analytics with PostgreSQL.
Database configurations
To access databases via ScalarDB Analytics with PostgreSQL, you must set the scalardbAnalyticsPostgreSQL.databaseProperties
parameter by following the same syntax that you use to configure the database.properties
file. For details about configurations, see ScalarDB Configurations.
scalardbAnalyticsPostgreSQL:
databaseProperties: |
scalar.db.contact_points=localhost
scalar.db.username=${env:SCALAR_DB_USERNAME:-}
scalar.db.password=${env:SCALAR_DB_PASSWORD:-}
scalar.db.storage=cassandra
Database namespaces configurations
You must set schemaImporter.namespaces
to all the database namespaces that include tables you want to read via ScalarDB Analytics with PostgreSQL.
schemaImporter:
namespaces:
- namespace1
- namespace2
- namespace3
Optional configurations
This section explains the optional configurations when setting up a custom values file for ScalarDB Analytics with PostgreSQL.
Resource configurations (recommended in production environments)
To control pod resources by using requests and limits in Kubernetes, you can use scalardbAnalyticsPostgreSQL.resources
.
You can configure requests and limits by using the same syntax as requests and limits in Kubernetes. For more details on requests and limits in Kubernetes, see Resource Management for Pods and Containers.
scalardbAnalyticsPostgreSQL:
resources:
requests:
cpu: 1000m
memory: 2Gi
limits:
cpu: 2000m
memory: 4Gi
Secret configurations (recommended in production environments)
To use environment variables to set some properties, like credentials, in scalardbAnalyticsPostgreSQL.databaseProperties
, you can use scalardbAnalyticsPostgreSQL.secretName
to specify the secret resource that includes some credentials.
For example, you can set credentials for a backend database (scalar.db.username
and scalar.db.password
) by using environment variables, which makes your pods more secure.
For more details on how to use a secret resource, see How to use Secret resources to pass the credentials as the environment variables into the properties file.
scalardbAnalyticsPostgreSQL:
secretName: "scalardb-analytics-postgresql-credentials-secret"
Affinity configurations (recommended in production environments)
To control pod deployment by using affinity and anti-affinity in Kubernetes, you can use scalardbAnalyticsPostgreSQL.affinity
.
You can configure affinity and anti-affinity by using the same syntax for affinity and anti-affinity in Kubernetes. For more details on configuring affinity in Kubernetes, see Assigning Pods to Nodes.
scalardbAnalyticsPostgreSQL:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- scalardb-analytics-postgresql
- key: app.kubernetes.io/app
operator: In
values:
- scalardb-analytics-postgresql
topologyKey: kubernetes.io/hostname