メインコンテンツまでスキップ
バージョン: 3.12

Deploy Scalar Manager

Scalar Manager is a centralized management and monitoring solution for ScalarDB and ScalarDL within Kubernetes cluster environments that allows you to:

  • Check the availability of ScalarDB or ScalarDL.
  • Schedule or execute pausing jobs that create transactionally consistent periods in the databases used by ScalarDB or ScalarDL.
  • Check the time-series metrics and logs of ScalarDB or ScalarDL through Grafana dashboards.

This guide explains how to deploy and access Scalar Manager on a Kubernetes cluster by using Scalar Helm Charts.

Prerequisites

Before you deploy Scalar Manager, you must do the following:

Deployment architecture diagram

The following is an architecture diagram for the components deployed in a Kubernetes cluster.

+--------------------------------------------------------------------------------------------------+
| +----------------------+ |
| | scalar-manager | |
| | | |
| | +------------------+ | --------------------------(Manage)--------------------------+ |
| | | Scalar Manager | | | |
| | +------------------+ | | |
| +--+-------------------+ | |
| | | |
| +------------------------------------+ | |
| | loki-stack | V |
| | | +-----------------+ |
| | +--------------+ +--------------+ | <----------------(Log)--------------- | Scalar Products | |
| | | Loki | | Promtail | | | | |
| | +--------------+ +--------------+ | | +-----------+ | |
| +------------------------------------+ | | ScalarDB | | |
| | | +-----------+ | |
| +------------------------------------------------------+ | | |
| | kube-prometheus-stack | | +-----------+ | |
| | | | | ScalarDL | | |
| | +--------------+ +--------------+ +--------------+ | -----(Monitor)----> | +-----------+ | |
| | | Prometheus | | Alertmanager | | Grafana | | +-----------------+ |
| | +-------+------+ +------+-------+ +------+-------+ | |
| | | | | | |
| | +----------------+-----------------+ | |
| | | | |
| +--------------------------+---------------------------+ |
| | | |
| | | Kubernetes |
+----+-----------------------+---------------------------------------------------------------------+
| |
Expose the environment to localhost (127.0.0.1) or use a load balancer to access it
| |
(Access the dashboard through HTTP)
| |
+----+----+ +----+----+
| Browser | <-(Embed)-- + Browser |
+---------+ +---------+

Step 1. Start minikube

Open Terminal, and start minikube by running the following command:

minikube start

Step 2. Upgrade the kube-prometheus-stack to allow Grafana to be embedded

In your custom values file for kube-prometheus-stack (for example, scalar-prometheus-custom-values.yaml), add the following configurations or revise them if they already exist:

kubeStateMetrics:
enabled: true

nodeExporter:
enabled: true

kubelet:
enabled: true

grafana:
grafana.ini:
users:
default_theme: light
security:
allow_embedding: true
auth.anonymous:
enabled: true
org_name: "Main Org."
org_role: Editor

Then, upgrade the Helm installation by running the following command:

helm upgrade scalar-monitoring prometheus-community/kube-prometheus-stack -n monitoring -f scalar-prometheus-custom-values.yaml

Step 3. Set environment variables

Set environment variables for Scalar Manager by running the following commands, replacing the contents in angle brackets as described:

SCALAR_MANAGER_RELEASE_NAME=<ADD_RELEASE_NAME>
SCALAR_MANAGER_NAMESPACE=<ADD_NAMESPACE>
SCALAR_MANAGER_CUSTOM_VALUES_FILE=<ADD_PATH_TO_CUSTOM_VALUES_FILE>
SCALAR_MANAGER_CHART_VERSION=<ADD_CHART_VERSION>

Step 4. Prepare a custom values file for Scalar Manager

Prepare a custom values file for Scalar Manager by doing the following:

  1. Create an empty file named scalar-manager-custom-values.yaml.
  2. Follow the instructions in Configure a custom values file for Scalar Manager.

Step 5. Install and deploy scalar-manager

Install and deploy the scalar-manager Helm Chart by running the following command:

helm install ${SCALAR_MANAGER_RELEASE_NAME} scalar-labs/scalar-manager -n ${SCALAR_MANAGER_NAMESPACE} -f ${SCALAR_MANAGER_CUSTOM_VALUES_FILE} --version ${SCALAR_MANAGER_CHART_VERSION}

Step 6. Access Scalar Manager

How you access Scalar Manager depends on the tool that you're using for Kubernetes clusters.

To expose Scalar Manager's service resource as your localhost (127.0.0.1), open another terminal, and run the minikube tunnel command.

minikube tunnel

Then, access Scalar Manager by going to http://localhost:8000.

Additional details

This section provides additional details related to configurations and resource discovery.

Upgrade the Scalar Manager deployment

To upgrade the deployment of Scalar Manager, run the following command:

helm upgrade ${SCALAR_MANAGER_RELEASE_NAME} scalar-labs/scalar-manager -n ${SCALAR_MANAGER_NAMESPACE} -f ${SCALAR_MANAGER_CUSTOM_VALUES_FILE} --version ${SCALAR_MANAGER_CHART_VERSION}

Uninstall Scalar Manager

To uninstall Scalar Manager, run the following command:

helm uninstall ${SCALAR_MANAGER_RELEASE_NAME} -n ${SCALAR_MANAGER_NAMESPACE}

Optional Scalar Manager configurations

For optional configurations that you can set for Scalar Manager, see Optional configurations

Resource discovery

Scalar Manager discovers the following Kubernetes resources in a cluster by using specific label selectors:

  • Dependencies
    • Prometheus service
    • Loki service
    • Grafana service
  • Targets
    • ScalarDB Cluster deployments
    • ScalarDL Ledger deployments
    • ScalarDL Auditor deployments

The following sections explain how Scalar Manager discovers these resources.

Dependencies

Scalar Manager searches for the default labels and values set in the kube-prometheus-stack and loki-stack Helm Charts. For more information on the default labels and values that Scalar Manager uses to discover dependencies, see Properties that you can set in api.applicationProperties.

Also, if you customized any values when installing kube-prometheus-stack or loki-stack, you will need to update the label selectors in the Scalar Manager custom value api.applicationProperties.

Targets

Scalar Manager searches for ScalarDB Cluster, ScalarDL Ledger, and ScalarDL Auditor deployments by using the following labels and values:

  • ScalarDB Cluster: app.kubernetes.io/app=scalardb-cluster
  • ScalarDL Ledger: app.kubernetes.io/app=ledger
  • ScalarDL Auditor: app.kubernetes.io/app=auditor

Scalar Helm Charts use fixed labels and values for ScalarDB Cluster, ScalarDL Ledger, and ScalarDL Auditor deployments so that if you install ScalarDB and ScalarDL by using Scalar Helm Charts, Scalar Manager will automatically discover these deployments.