Getting Started with Helm Charts (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.
For more details, refer to Scalar Manager Overview.
This guide will show you how to deploy and access Scalar Manager on a Kubernetes cluster.
Assumption
This guide assumes that you are aware of how to deploy ScalarDB or ScalarDL with the monitoring and logging tools to a Kubernetes cluster.
Requirement
- You must deploy
kube-prometheus-stack
according to the instructions in Getting Started with Helm Charts (Monitoring using Prometheus Operator). - You must deploy
loki-stack
according to the instructions in Getting Started with Helm Charts (Logging using Loki Stack).
What we create
We will deploy the following components on a Kubernetes cluster as follows.
+--------------------------------------------------------------------------------------------------+
| +----------------------+ |
| | scalar-manager | |
| | | |
| | +------------------+ | --------------------------(Manage)--------------------------+ |
| | | Scalar Manager | | | |
| | +------------------+ | | |
| +--+-------------------+ | |
| | | |
| +------------------------------------+ | |
| | loki-stack | V |
| | | +-----------------+ |
| | +--------------+ +--------------+ | <----------------(Log)--------------- | Scalar Products | |
| | | Loki | | Promtail | | | | |
| | +--------------+ +--------------+ | | +-----------+ | |
| +------------------------------------+ | | ScalarDB | | |
| | | +-----------+ | |
| +------------------------------------------------------+ | | |
| | kube-prometheus-stack | | +-----------+ | |
| | | | | ScalarDL | | |
| | +--------------+ +--------------+ +--------------+ | -----(Monitor)----> | +-----------+ | |
| | | Prometheus | | Alertmanager | | Grafana | | +-----------------+ |
| | +-------+------+ +------+-------+ +------+-------+ | |
| | | | | | |
| | +----------------+-----------------+ | |
| | | | |
| +--------------------------+---------------------------+ |
| | | |
| | | Kubernetes |
+----+-----------------------+---------------------------------------------------------------------+
| |
expose to localhost (127.0.0.1) or use load balancer etc to access
| |
(Access Dashboard through HTTP)
| |
+----+----+ +----+----+
| Browser | <-(Embed)-- + Browser |
+---------+ +---------+
Step 1. Upgrade the kube-prometheus-stack
to allow Grafana to be embedded
-
Add or revise this value to the custom values file (e.g. scalar-prometheus-custom-values.yaml) of the
kube-prometheus-stack
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 -
Upgrade the Helm installation
helm upgrade scalar-monitoring prometheus-community/kube-prometheus-stack -n monitoring -f scalar-prometheus-custom-values.yaml
Step 2. Prepare a custom values file for Scalar Manager
-
Create an empty .yaml file named
scalar-manager-custom-values.yaml
forscalar-manager
. -
Set the service type to access Scalar Manager. The default value is
ClusterIP
, but if we access using theminikube tunnel
command or some load balancer, we can set it asLoadBalancer
.service:
type: LoadBalancer
port: 8000
Step 3. Deploy scalar-manager
- Deploy the
scalar-manager
Helm Chart.helm install scalar-manager scalar-labs/scalar-manager -f scalar-manager-custom-values.yaml
Step 4. Access Scalar Manager
If you use minikube
-
To expose Scalar Manager's service resource as your
localhost (127.0.0.1)
, open another terminal, and run theminikube tunnel
command.minikube tunnel
-
Open the browser with URL
http://localhost:8000
If you use other Kubernetes than minikube
If you're using a Kubernetes cluster other than minikube, you'll need to access the LoadBalancer
service according to the manner of each Kubernetes cluster. For example, you'll need to use a load balancer provided by your cloud services provider or use the kubectl port-forward
command.
Scalar Manager will try to detect the external IP of Grafana and then embed Grafana based on the IP. Therefore, you must configure the Grafana service type as LoadBalancer
, and the external IP must be accessible from your browser.
Step 5. Delete Scalar Manager
- Uninstall
scalar-manager
helm uninstall scalar-manager
Additional details
This section provides additional details related to configurations and resource discovery.
Configurations
You can see configurations for Scalar Manager in Configure a custom values file for Scalar Manager
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.