Configure a custom values file for ScalarDB Cluster
This document explains how to create your custom values file for the ScalarDB Cluster chart. For details on the parameters, see the README of the ScalarDB Cluster chart.
Required configurations
Image configurations
You must set scalardbCluster.image.repository
. Be sure to specify the ScalarDB Cluster container image so that you can pull the image from the container repository.
scalardbCluster:
image:
repository: <SCALARDB_CLUSTER_CONTAINER_IMAGE>
Database configurations
You must set scalardbCluster.scalardbClusterNodeProperties
. Please set scalardb-cluster-node.properties
to this parameter. For more details on the configurations of ScalarDB Cluster, see ScalarDB Cluster Configurations.
scalardbCluster:
scalardbClusterNodeProperties: |
scalar.db.cluster.membership.type=KUBERNETES
scalar.db.cluster.membership.kubernetes.endpoint.namespace_name=${env:SCALAR_DB_CLUSTER_MEMBERSHIP_KUBERNETES_ENDPOINT_NAMESPACE_NAME}
scalar.db.cluster.membership.kubernetes.endpoint.name=${env:SCALAR_DB_CLUSTER_MEMBERSHIP_KUBERNETES_ENDPOINT_NAME}
scalar.db.contact_points=localhost
scalar.db.username=${env:SCALAR_DB_USERNAME}
scalar.db.password=${env:SCALAR_DB_PASSWORD}
scalar.db.storage=cassandra
Note that you must always set the following three properties if you deploy ScalarDB Cluster in a Kubernetes environment by using Scalar Helm Chart. These properties are fixed values. Since the properties don't depend on individual environments, you can set the same values by copying the following values and pasting them in scalardbCluster.scalardbClusterNodeProperties
.
scalardbCluster:
scalardbClusterNodeProperties: |
scalar.db.cluster.membership.type=KUBERNETES
scalar.db.cluster.membership.kubernetes.endpoint.namespace_name=${env:SCALAR_DB_CLUSTER_MEMBERSHIP_KUBERNETES_ENDPOINT_NAMESPACE_NAME}
scalar.db.cluster.membership.kubernetes.endpoint.name=${env:SCALAR_DB_CLUSTER_MEMBERSHIP_KUBERNETES_ENDPOINT_NAME}
Optional configurations
Resource configurations (recommended in production environments)
To control pod resources by using requests and limits in Kubernetes, you can use scalardbCluster.resources
.
Note that, for commercial licenses, the resources for each pod of Scalar products are limited to 2vCPU / 4GB memory. Also, if you use the pay-as-you-go containers that the AWS Marketplace provides, you will not be able to run any containers that exceed the 2vCPU / 4GB memory configuration in resources.limits
. If you exceed this resource limitation, the pods will automatically stop.
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.
scalardbCluster:
resources:
requests:
cpu: 2000m
memory: 4Gi
limits:
cpu: 2000m
memory: 4Gi
Secret configurations (recommended in production environments)
To use environment variables to set some properties (e.g., credentials) in scalardbCluster.scalardbClusterNodeProperties
, you can use scalardbCluster.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.
scalardbCluster:
secretName: "scalardb-cluster-credentials-secret"
Affinity configurations (recommended in production environments)
To control pod deployment by using affinity and anti-affinity in Kubernetes, you can use scalardbCluster.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.
scalardbCluster:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- scalardb-cluster
- key: app.kubernetes.io/app
operator: In
values:
- scalardb-cluster
topologyKey: kubernetes.io/hostname
weight: 50
Prometheus and Grafana configurations (recommended in production environments)
To monitor ScalarDB Cluster pods by using kube-prometheus-stack, you can set scalardbCluster.grafanaDashboard.enabled
, scalardbCluster.serviceMonitor.enabled
, and scalardbCluster.prometheusRule.enabled
to true
. When you set these configurations to true
, the chart deploys the necessary resources and kube-prometheus-stack starts monitoring automatically.
scalardbCluster:
grafanaDashboard:
enabled: true
namespace: monitoring
serviceMonitor:
enabled: true
namespace: monitoring
interval: 15s
prometheusRule:
enabled: true
namespace: monitoring