[Deprecated] Getting Started with Helm Charts (ScalarDB Server)
ScalarDB Server is now deprecated. Please use ScalarDB Cluster instead.
This document explains how to get started with ScalarDB Server using Helm Chart on a Kubernetes cluster as a test environment. Here, we assume that you already have a Mac or Linux environment for testing. We use Minikube in this document, but the steps we will show should work in any Kubernetes cluster.
Requirement
- You need to subscribe to ScalarDB in the AWS Marketplace or Azure Marketplace to get container images (
scalardb-server
andscalardb-envoy
). Please refer to the following documents for more details.
What we create
We will deploy the following components on a Kubernetes cluster as follows.
+--------------------------------------------------------------------------------------------------------------------------------------+
| [Kubernetes Cluster] |
| |
| [Pod] [Pod] [Pod] [Pod] |
| |
| +-------+ +-----------------+ |
| +---> | Envoy | ---+ +---> | ScalarDB Server | ---+ |
| | +-------+ | | +-----------------+ | |
| | | | | |
| +--------+ +---------+ | +-------+ | +-------------------+ | +-----------------+ | +------------+ |
| | Client | ---> | Service | ---+---> | Envoy | ---+---> | Service | ---+---> | ScalarDB Server | ---+---> | PostgreSQL | |
| +--------+ | (Envoy) | | +-------+ | | (ScalarDB Server) | | +-----------------+ | +------------+ |
| +---------+ | | +-------------------+ | | |
| | +-------+ | | +-----------------+ | |
| +---> | Envoy | ---+ +---> | ScalarDB Server | ---+ |
| +-------+ +-----------------+ |
| |
+--------------------------------------------------------------------------------------------------------------------------------------+
Step 1. Start a Kubernetes cluster
First, you need to prepare a Kubernetes cluster. If you use a minikube environment, please refer to the Getting Started with Scalar Helm Charts. If you have already started a Kubernetes cluster, you can skip this step.
Step 2. Start a PostgreSQL container
ScalarDB uses some kind of database system as a backend database. In this document, we use PostgreSQL.
You can deploy PostgreSQL on the Kubernetes cluster as follows.
-
Add the Bitnami helm repository.
helm repo add bitnami https://charts.bitnami.com/bitnami
-
Deploy PostgreSQL.
helm install postgresql-scalardb bitnami/postgresql \
--set auth.postgresPassword=postgres \
--set primary.persistence.enabled=false -
Check if the PostgreSQL container is running.
kubectl get pod
[Command execution result]
NAME READY STATUS RESTARTS AGE
postgresql-scalardb-0 1/1 Running 0 2m42s
Step 3. Deploy ScalarDB Server on the Kubernetes cluster using Helm Charts
-
Add the Scalar helm repository.
helm repo add scalar-labs https://scalar-labs.github.io/helm-charts
-
Create a secret resource to pull the ScalarDB container images from AWS/Azure Marketplace.
- AWS Marketplace
kubectl create secret docker-registry reg-ecr-mp-secrets \
--docker-server=709825985650.dkr.ecr.us-east-1.amazonaws.com \
--docker-username=AWS \
--docker-password=$(aws ecr get-login-password --region us-east-1) - Azure Marketplace
kubectl create secret docker-registry reg-acr-secrets \
--docker-server=<your private container registry login server> \
--docker-username=<Service principal ID> \
--docker-password=<Service principal password>
Please refer to the following documents for more details.
- AWS Marketplace
-
Create a custom values file for ScalarDB Server (scalardb-custom-values.yaml).
-
AWS Marketplace
cat << 'EOF' > scalardb-custom-values.yaml
envoy:
image:
repository: "709825985650.dkr.ecr.us-east-1.amazonaws.com/scalar/scalardb-envoy"
version: "1.3.0"
imagePullSecrets:
- name: "reg-ecr-mp-secrets"
scalardb:
image:
repository: "709825985650.dkr.ecr.us-east-1.amazonaws.com/scalar/scalardb-server"
tag: "3.7.0"
imagePullSecrets:
- name: "reg-ecr-mp-secrets"
databaseProperties: |
scalar.db.storage=jdbc
scalar.db.contact_points=jdbc:postgresql://postgresql-scalardb.default.svc.cluster.local:5432/postgres
scalar.db.username={{ default .Env.SCALAR_DB_POSTGRES_USERNAME "" }}
scalar.db.password={{ default .Env.SCALAR_DB_POSTGRES_PASSWORD "" }}
secretName: "scalardb-credentials-secret"
EOF
-