diff --git a/docs/3.8/helm-charts/README.md b/docs/3.8/helm-charts/README.md index 2bc4da97..ec363aef 100644 --- a/docs/3.8/helm-charts/README.md +++ b/docs/3.8/helm-charts/README.md @@ -1,9 +1,9 @@ # Index ## For users -* [Getting Started with Scalar Helm Charts](./getting-started-scalar-helm-charts.md) -* [Configure a custom values file for Scalar Helm Chart](./configure-custom-values-file.md) -* [Deploy Scalar products using Scalar Helm Charts](./how-to-deploy-scalar-products.md) +* [Getting Started with Scalar Helm Charts](getting-started-scalar-helm-charts.md) +* [Configure a custom values file for Scalar Helm Chart](configure-custom-values-file.md) +* [Deploy Scalar products using Scalar Helm Charts](how-to-deploy-scalar-products.md) ## For developers -* [Release Flow](./ReleaseFlow.md) +* [Release Flow](ReleaseFlow.md) diff --git a/docs/3.8/helm-charts/ReleaseFlow.md b/docs/3.8/helm-charts/ReleaseFlow.md new file mode 100644 index 00000000..18e1816f --- /dev/null +++ b/docs/3.8/helm-charts/ReleaseFlow.md @@ -0,0 +1,24 @@ +# Release Flow + +## Requirements +| Name | Version | Mandatory | link | +|:------|:-------|:----------|:------| +| Helm | 3.2.1 or latest | no | https://helm.sh/docs/intro/install/ | + +## Release +* You create a branch (`prepare-release-*`). +* You make sure to create the tag from the previous version of the target version. +``` console +$ git checkout -b prepare-release-v3.0.2 refs/tags/scalardl-3.0.1 +``` + +* You need to set the `version` of the `Chart.yaml` of each `helm-charts` to the version to be released. +``` yaml +version: 3.0.2 +``` +* Pushing commits to a remote repository. +``` console +$ git push origin prepare-release-v3.0.2 +``` + +* In this case, the `Github Actions` for the release will be executed upon `Git push`. diff --git a/docs/3.8/helm-charts/conf/scalar-loki-stack-custom-values.yaml b/docs/3.8/helm-charts/conf/scalar-loki-stack-custom-values.yaml index f078536a..997537a5 100644 --- a/docs/3.8/helm-charts/conf/scalar-loki-stack-custom-values.yaml +++ b/docs/3.8/helm-charts/conf/scalar-loki-stack-custom-values.yaml @@ -53,3 +53,28 @@ promtail: - __meta_kubernetes_pod_uid - __meta_kubernetes_pod_container_name target_label: __path__ + # -- the `scalar-admin-for-kubernetes` job scrapes all the logs of Scalar Admin for Kubernetes Pods + - job_name: scalar-admin-for-kubernetes + pipeline_stages: + - docker: {} + - cri: {} + kubernetes_sd_configs: + - role: pod + relabel_configs: + - source_labels: + - __meta_kubernetes_pod_node_name + target_label: __host__ + - action: replace + source_labels: + - __meta_kubernetes_pod_name + target_label: pod + - action: keep + regex: (.*)scalar-admin-for-kubernetes-(.+) + source_labels: + - pod + - replacement: /var/log/pods/*$1/*.log + separator: / + source_labels: + - __meta_kubernetes_pod_uid + - __meta_kubernetes_pod_container_name + target_label: __path__ diff --git a/docs/3.8/helm-charts/configure-custom-values-file.md b/docs/3.8/helm-charts/configure-custom-values-file.md index c228d413..59659efd 100644 --- a/docs/3.8/helm-charts/configure-custom-values-file.md +++ b/docs/3.8/helm-charts/configure-custom-values-file.md @@ -2,12 +2,13 @@ When you deploy Scalar products using Scalar Helm Charts, you must prepare your custom values file based on your environment. Please refer to the following documents for more details on how to a create custom values file for each product. -* [ScalarDB Cluster](./configure-custom-values-scalardb-cluster.md) -* [ScalarDL Ledger](./configure-custom-values-scalardl-ledger.md) -* [ScalarDL Auditor](./configure-custom-values-scalardl-auditor.md) -* [ScalarDL Schema Loader](./configure-custom-values-scalardl-schema-loader.md) -* [Scalar Admin for Kubernetes](./configure-custom-values-scalar-admin-for-kubernetes.md) -* [Scalar Manager](./configure-custom-values-scalar-manager.md) -* [Envoy](./configure-custom-values-envoy.md) -* [[Deprecated] ScalarDB Server](./configure-custom-values-scalardb.md) -* [[Deprecated] ScalarDB GraphQL](./configure-custom-values-scalardb-graphql.md) +* [ScalarDB Cluster](configure-custom-values-scalardb-cluster.md) +* [ScalarDB Analytics with PostgreSQL](configure-custom-values-scalardb-analytics-postgresql.md) +* [ScalarDL Ledger](configure-custom-values-scalardl-ledger.md) +* [ScalarDL Auditor](configure-custom-values-scalardl-auditor.md) +* [ScalarDL Schema Loader](configure-custom-values-scalardl-schema-loader.md) +* [Scalar Admin for Kubernetes](configure-custom-values-scalar-admin-for-kubernetes.md) +* [Scalar Manager](configure-custom-values-scalar-manager.md) +* [Envoy](configure-custom-values-envoy.md) +* [[Deprecated] ScalarDB Server](configure-custom-values-scalardb.md) +* [[Deprecated] ScalarDB GraphQL](configure-custom-values-scalardb-graphql.md) diff --git a/docs/3.8/helm-charts/configure-custom-values-scalardb-analytics-postgresql.md b/docs/3.8/helm-charts/configure-custom-values-scalardb-analytics-postgresql.md new file mode 100644 index 00000000..f57800ac --- /dev/null +++ b/docs/3.8/helm-charts/configure-custom-values-scalardb-analytics-postgresql.md @@ -0,0 +1,185 @@ +# 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](https://github.com/scalar-labs/helm-charts/blob/main/charts/scalardb-analytics-postgresql/README.md) 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](https://github.com/scalar-labs/scalardb/blob/master/docs/configurations.md). + +```yaml +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. + +```yaml +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](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/). + +```yaml +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](use-secret-for-credentials.md). + +```yaml +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](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/). + +```yaml +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 +``` + +### SecurityContext configurations (default value is recommended) + +To set SecurityContext and PodSecurityContext for ScalarDB Analytics with PostgreSQL pods, you can use `scalardbAnalyticsPostgreSQL.securityContext`, `scalardbAnalyticsPostgreSQL.podSecurityContext`, and `schemaImporter.securityContext`. + +You can configure SecurityContext and PodSecurityContext by using the same syntax as SecurityContext and PodSecurityContext in Kubernetes. For more details on the SecurityContext and PodSecurityContext configurations in Kubernetes, see [Configure a Security Context for a Pod or Container](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/). + +```yaml +scalardbAnalyticsPostgreSQL: + podSecurityContext: + fsGroup: 201 + seccompProfile: + type: RuntimeDefault + securityContext: + capabilities: + drop: + - ALL + runAsNonRoot: true + runAsUser: 999 + allowPrivilegeEscalation: false + +schemaImporter: + securityContext: + capabilities: + drop: + - ALL + runAsNonRoot: true + allowPrivilegeEscalation: false +``` + +### Image configurations (default value is recommended) + +If you want to change the image repository, you can use `scalardbAnalyticsPostgreSQL.image.repository` and `schemaImporter.image.repository` to specify the container repository information of the ScalarDB Analytics with PostgreSQL and Schema Importer images that you want to pull. + +```yaml +scalardbAnalyticsPostgreSQL: + image: + repository: + +schemaImporter: + image: + repository: +``` + +### Replica configurations (optional based on your environment) + +You can specify the number of ScalarDB Analytics with PostgreSQL replicas (pods) by using `scalardbAnalyticsPostgreSQL.replicaCount`. + +```yaml +scalardbAnalyticsPostgreSQL: + replicaCount: 3 +``` + +### PostgreSQL database name configuration (optional based on your environment) + +You can specify the database name that you create in PostgreSQL. Schema Importer creates some objects, such as a view of ScalarDB Analytics with PostgreSQL, in this database. + +```yaml +scalardbAnalyticsPostgreSQL: + postgresql: + databaseName: scalardb +``` + +### PostgreSQL superuser password configuration (optional based on your environment) + +You can specify the secret name that includes the superuser password for PostgreSQL. + +```yaml +scalardbAnalyticsPostgreSQL: + postgresql: + secretName: scalardb-analytics-postgresql-superuser-password +``` + +{% capture notice--info %} +**Note** + +You must create a secret resource with this name (`scalardb-analytics-postgresql-superuser-password` by default) before you deploy ScalarDB Analytics with PostgreSQL. For details, see [Prepare a secret resource](how-to-deploy-scalardb-analytics-postgresql.md#prepare-a-secret-resource). +{% endcapture %} + +
{{ notice--info | markdownify }}
+ +### Taint and toleration configurations (optional based on your environment) + +If you want to control pod deployment by using taints and tolerations in Kubernetes, you can use `scalardbAnalyticsPostgreSQL.tolerations`. + +You can configure taints and tolerations by using the same syntax as the tolerations in Kubernetes. For details on configuring tolerations in Kubernetes, see the official Kubernetes documentation [Taints and Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/). + +```yaml +scalardbAnalyticsPostgreSQL: + tolerations: + - effect: NoSchedule + key: scalar-labs.com/dedicated-node + operator: Equal + value: scalardb-analytics-postgresql +``` diff --git a/docs/3.8/helm-charts/configure-custom-values-scalardb-cluster.md b/docs/3.8/helm-charts/configure-custom-values-scalardb-cluster.md index 397d41c2..85aeaeb8 100644 --- a/docs/3.8/helm-charts/configure-custom-values-scalardb-cluster.md +++ b/docs/3.8/helm-charts/configure-custom-values-scalardb-cluster.md @@ -67,7 +67,7 @@ To use environment variables to set some properties (e.g., credentials) in `scal 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](./use-secret-for-credentials.md). +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](use-secret-for-credentials.md). ```yaml scalardbCluster: diff --git a/docs/3.8/helm-charts/configure-custom-values-scalardb-graphql.md b/docs/3.8/helm-charts/configure-custom-values-scalardb-graphql.md index b001c562..0a01349a 100644 --- a/docs/3.8/helm-charts/configure-custom-values-scalardb-graphql.md +++ b/docs/3.8/helm-charts/configure-custom-values-scalardb-graphql.md @@ -3,7 +3,7 @@ {% capture notice--info %} **Note** -ScalarDB GraphQL Server is now deprecated. Please use [ScalarDB Cluster](./configure-custom-values-scalardb-cluster.md) instead. +ScalarDB GraphQL Server is now deprecated. Please use [ScalarDB Cluster](configure-custom-values-scalardb-cluster.md) instead. {% endcapture %}
{{ notice--info | markdownify }}
diff --git a/docs/3.8/helm-charts/configure-custom-values-scalardb.md b/docs/3.8/helm-charts/configure-custom-values-scalardb.md index 55f2fb48..6652d6e9 100644 --- a/docs/3.8/helm-charts/configure-custom-values-scalardb.md +++ b/docs/3.8/helm-charts/configure-custom-values-scalardb.md @@ -3,7 +3,7 @@ {% capture notice--info %} **Note** -ScalarDB Server is now deprecated. Please use [ScalarDB Cluster](./configure-custom-values-scalardb-cluster.md) instead. +ScalarDB Server is now deprecated. Please use [ScalarDB Cluster](configure-custom-values-scalardb-cluster.md) instead. {% endcapture %}
{{ notice--info | markdownify }}
@@ -91,7 +91,7 @@ If you want to use environment variables to set some properties (e.g., credentia For example, you can set credentials for a backend database (`scalar.db.username` and `scalar.db.password`) using environment variables, which makes your pods more secure. -Please refer to the document [How to use Secret resources to pass the credentials as the environment variables into the properties file](./use-secret-for-credentials.md) for more details on how to use a Secret resource. +Please refer to the document [How to use Secret resources to pass the credentials as the environment variables into the properties file](use-secret-for-credentials.md) for more details on how to use a Secret resource. ```yaml scalardb: diff --git a/docs/3.8/helm-charts/configure-custom-values-scalardl-auditor.md b/docs/3.8/helm-charts/configure-custom-values-scalardl-auditor.md index 39543bc9..ed616b70 100644 --- a/docs/3.8/helm-charts/configure-custom-values-scalardl-auditor.md +++ b/docs/3.8/helm-charts/configure-custom-values-scalardl-auditor.md @@ -57,7 +57,7 @@ You must set a private key file to `scalar.dl.auditor.private_key_path` and a ce You must also mount the private key file and the certificate file on the ScalarDL Auditor pod. -For more details on how to mount the private key file and the certificate file, refer to [Mount key and certificate files on a pod in ScalarDL Helm Charts](./mount-files-or-volumes-on-scalar-pods.md#mount-key-and-certificate-files-on-a-pod-in-scalardl-helm-charts). +For more details on how to mount the private key file and the certificate file, refer to [Mount key and certificate files on a pod in ScalarDL Helm Charts](mount-files-or-volumes-on-scalar-pods.md#mount-key-and-certificate-files-on-a-pod-in-scalardl-helm-charts). ## Optional configurations @@ -86,7 +86,7 @@ If you want to use environment variables to set some properties (e.g., credentia For example, you can set credentials for a backend database (`scalar.db.username` and `scalar.db.password`) using environment variables, which makes your pods more secure. -Please refer to the document [How to use Secret resources to pass the credentials as the environment variables into the properties file](./use-secret-for-credentials.md) for more details on how to use a Secret resource. +Please refer to the document [How to use Secret resources to pass the credentials as the environment variables into the properties file](use-secret-for-credentials.md) for more details on how to use a Secret resource. ```yaml auditor: diff --git a/docs/3.8/helm-charts/configure-custom-values-scalardl-ledger.md b/docs/3.8/helm-charts/configure-custom-values-scalardl-ledger.md index 3b06fd50..4786376b 100644 --- a/docs/3.8/helm-charts/configure-custom-values-scalardl-ledger.md +++ b/docs/3.8/helm-charts/configure-custom-values-scalardl-ledger.md @@ -57,7 +57,7 @@ If you set `scalar.dl.ledger.proof.enabled` to `true` (this configuration is req In this case, you must mount the private key file on the ScalarDL Ledger pod. -For more details on how to mount the private key file, refer to [Mount key and certificate files on a pod in ScalarDL Helm Charts](./mount-files-or-volumes-on-scalar-pods.md#mount-key-and-certificate-files-on-a-pod-in-scalardl-helm-charts). +For more details on how to mount the private key file, refer to [Mount key and certificate files on a pod in ScalarDL Helm Charts](mount-files-or-volumes-on-scalar-pods.md#mount-key-and-certificate-files-on-a-pod-in-scalardl-helm-charts). ## Optional configurations @@ -86,7 +86,7 @@ If you want to use environment variables to set some properties (e.g., credentia For example, you can set credentials for a backend database (`scalar.db.username` and `scalar.db.password`) using environment variables, which makes your pods more secure. -Please refer to the document [How to use Secret resources to pass the credentials as the environment variables into the properties file](./use-secret-for-credentials.md) for more details on how to use a Secret resource. +Please refer to the document [How to use Secret resources to pass the credentials as the environment variables into the properties file](use-secret-for-credentials.md) for more details on how to use a Secret resource. ```yaml ledger: diff --git a/docs/3.8/helm-charts/configure-custom-values-scalardl-schema-loader.md b/docs/3.8/helm-charts/configure-custom-values-scalardl-schema-loader.md index 655448d7..82c9a0b1 100644 --- a/docs/3.8/helm-charts/configure-custom-values-scalardl-schema-loader.md +++ b/docs/3.8/helm-charts/configure-custom-values-scalardl-schema-loader.md @@ -59,7 +59,7 @@ If you want to use environment variables to set some properties (e.g., credentia For example, you can set credentials for a backend database (`scalar.db.username` and `scalar.db.password`) using environment variables, which makes your pods more secure. -Please refer to the document [How to use Secret resources to pass the credentials as the environment variables into the properties file](./use-secret-for-credentials.md) for more details on how to use a Secret resource. +Please refer to the document [How to use Secret resources to pass the credentials as the environment variables into the properties file](use-secret-for-credentials.md) for more details on how to use a Secret resource. ```yaml schemaLoading: diff --git a/docs/3.8/helm-charts/getting-started-logging.md b/docs/3.8/helm-charts/getting-started-logging.md index 5f5aa2f4..e6bd5396 100644 --- a/docs/3.8/helm-charts/getting-started-logging.md +++ b/docs/3.8/helm-charts/getting-started-logging.md @@ -2,7 +2,7 @@ This document explains how to get started with log aggregation for Scalar products on Kubernetes using Grafana Loki (with Promtail). -We assume that you have already read the [getting-started with monitoring](./getting-started-monitoring.md) for Scalar products and installed kube-prometheus-stack. +We assume that you have already read the [getting-started with monitoring](getting-started-monitoring.md) for Scalar products and installed kube-prometheus-stack. ## What we create @@ -42,18 +42,16 @@ We will deploy the following components on a Kubernetes cluster as follows. ## Step 1. Prepare a custom values file -1. Get the sample file [scalar-loki-stack-custom-values.yaml](./conf/scalar-loki-stack-custom-values.yaml) for the `loki-stack` helm chart. +1. Get the sample file [scalar-loki-stack-custom-values.yaml](conf/scalar-loki-stack-custom-values.yaml) for the `loki-stack` helm chart. ## Step 2. Deploy `loki-stack` 1. Add the `grafana` helm repository. - ```console helm repo add grafana https://grafana.github.io/helm-charts ``` 1. Deploy the `loki-stack` helm chart. - ```console helm install scalar-logging-loki grafana/loki-stack -n monitoring -f scalar-loki-stack-custom-values.yaml ``` @@ -61,7 +59,6 @@ We will deploy the following components on a Kubernetes cluster as follows. ## Step 3. Add a Loki data source in the Grafana configuration 1. Add a configuration of the Loki data source in the `scalar-prometheus-custom-values.yaml` file. - ```yaml grafana: additionalDataSources: @@ -75,7 +72,6 @@ We will deploy the following components on a Kubernetes cluster as follows. ``` 1. Apply the configuration (upgrade the deployment of `kube-prometheus-stack`). - ```console helm upgrade scalar-monitoring prometheus-community/kube-prometheus-stack -n monitoring -f scalar-prometheus-custom-values.yaml ``` @@ -90,7 +86,6 @@ We will deploy the following components on a Kubernetes cluster as follows. ## Step 5. Delete the `loki-stack` helm chart 1. Uninstall `loki-stack`. - ```console helm uninstall scalar-logging-loki -n monitoring ``` diff --git a/docs/3.8/helm-charts/getting-started-monitoring.md b/docs/3.8/helm-charts/getting-started-monitoring.md index 9c4993a4..2bf59137 100644 --- a/docs/3.8/helm-charts/getting-started-monitoring.md +++ b/docs/3.8/helm-charts/getting-started-monitoring.md @@ -32,11 +32,11 @@ We will deploy the following components on a Kubernetes cluster as follows. ## 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](./getting-started-scalar-helm-charts.md). If you have already started a Kubernetes cluster, you can skip this step. +First, you need to prepare a Kubernetes cluster. If you use a **minikube** environment, please refer to the [Getting Started with Scalar Helm Charts](getting-started-scalar-helm-charts.md). If you have already started a Kubernetes cluster, you can skip this step. ## Step 2. Prepare a custom values file -1. Save the sample file [scalar-prometheus-custom-values.yaml](./conf/scalar-prometheus-custom-values.yaml) for `kube-prometheus-stack`. +1. Save the sample file [scalar-prometheus-custom-values.yaml](conf/scalar-prometheus-custom-values.yaml) for `kube-prometheus-stack`. 1. Add custom values in the `scalar-prometheus-custom-values.yaml` as follows. * settings @@ -96,9 +96,9 @@ First, you need to prepare a Kubernetes cluster. If you use a **minikube** envir * Note: * The following explains the minimum steps. If you want to know more details about the deployment of ScalarDB and ScalarDL, please refer to the following documents. - * [Getting Started with Helm Charts (ScalarDB Server)](./getting-started-scalardb.md) - * [Getting Started with Helm Charts (ScalarDL Ledger / Ledger only)](./getting-started-scalardl-ledger.md) - * [Getting Started with Helm Charts (ScalarDL Ledger and Auditor / Auditor mode)](./getting-started-scalardl-auditor.md) + * [Getting Started with Helm Charts (ScalarDB Server)](getting-started-scalardb.md) + * [Getting Started with Helm Charts (ScalarDL Ledger / Ledger only)](getting-started-scalardl-ledger.md) + * [Getting Started with Helm Charts (ScalarDL Ledger and Auditor / Auditor mode)](getting-started-scalardl-auditor.md) 1. To enable Prometheus monitoring of Scalar products, set `true` to the following configurations in the custom values file. * Configurations diff --git a/docs/3.8/helm-charts/getting-started-scalar-helm-charts.md b/docs/3.8/helm-charts/getting-started-scalar-helm-charts.md index 4e1005e0..3270b3f3 100644 --- a/docs/3.8/helm-charts/getting-started-scalar-helm-charts.md +++ b/docs/3.8/helm-charts/getting-started-scalar-helm-charts.md @@ -53,10 +53,10 @@ First, you need to install the following tools used in this guide. After the Kubernetes cluster starts, you can try each Scalar Helm Charts on it. Please refer to the following documents for more details. -* [ScalarDB Analytics with PostgreSQL](./getting-started-scalardb-analytics-postgresql.md) -* [ScalarDL Ledger (Ledger only)](./getting-started-scalardl-ledger.md) -* [ScalarDL Ledger and Auditor (Auditor mode)](./getting-started-scalardl-auditor.md) -* [Monitoring using Prometheus Operator](./getting-started-monitoring.md) - * [Logging using Loki Stack](./getting-started-logging.md) - * [Scalar Manager](./getting-started-scalar-manager.md) -* [[Deprecated] ScalarDB Server](./getting-started-scalardb.md) +* [ScalarDB Analytics with PostgreSQL](getting-started-scalardb-analytics-postgresql.md) +* [ScalarDL Ledger (Ledger only)](getting-started-scalardl-ledger.md) +* [ScalarDL Ledger and Auditor (Auditor mode)](getting-started-scalardl-auditor.md) +* [Monitoring using Prometheus Operator](getting-started-monitoring.md) + * [Logging using Loki Stack](getting-started-logging.md) + * [Scalar Manager](getting-started-scalar-manager.md) +* [[Deprecated] ScalarDB Server](getting-started-scalardb.md) diff --git a/docs/3.8/helm-charts/getting-started-scalar-manager.md b/docs/3.8/helm-charts/getting-started-scalar-manager.md index 1864bab3..a2766744 100644 --- a/docs/3.8/helm-charts/getting-started-scalar-manager.md +++ b/docs/3.8/helm-charts/getting-started-scalar-manager.md @@ -9,7 +9,7 @@ Scalar Manager also embeds Grafana explorers by which the users can review the m ## Assumption This guide assumes that the users are aware of how to deploy Scalar products with the monitoring and logging tools to a Kubernetes cluster. -If not, please start with [Getting Started with Scalar Helm Charts](./getting-started-scalar-helm-charts.md) before this guide. +If not, please start with [Getting Started with Scalar Helm Charts](getting-started-scalar-helm-charts.md) before this guide. ## Requirement @@ -64,7 +64,6 @@ We will deploy the following components on a Kubernetes cluster as follows. ## Step 1. Upgrade the `kube-prometheus-stack` to allow Grafana to be embedded 1. Add or revise this value to the custom values file (e.g. scalar-prometheus-custom-values.yaml) of the `kube-prometheus-stack` - ```yaml grafana: grafana.ini: @@ -74,17 +73,15 @@ We will deploy the following components on a Kubernetes cluster as follows. ``` 1. Upgrade the Helm installation - ```console 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 -1. Get the sample file [scalar-manager-custom-values.yaml](./conf/scalar-manager-custom-values.yaml) for `scalar-manager`. +1. Get the sample file [scalar-manager-custom-values.yaml](conf/scalar-manager-custom-values.yaml) for `scalar-manager`. 1. Add the targets that you would like to manage. For example, if we want to manage a ledger cluster, then we can add the values as follows. - ```yaml scalarManager: targets: @@ -92,25 +89,21 @@ We will deploy the following components on a Kubernetes cluster as follows. adminSrv: _scalardl-admin._tcp.scalardl-headless.default.svc.cluster.local databaseType: cassandra ``` - Note: the `adminSrv` is the DNS Service URL that returns SRV record of pods. Kubernetes creates this URL for the named port of the headless service of the Scalar product. The format is `_{port name}._{protocol}.{service name}.{namespace}.svc.{cluster domain name}` 1. Set the Grafana URL. For example, if your Grafana of the `kube-prometheus-stack` is exposed in `localhost:3000`, then we can set it as follows. - ```yaml scalarManager: grafanaUrl: "http://localhost:3000" ``` 1. Set the refresh interval that Scalar Manager checks the status of the products. The default value is `30` seconds, but we can change it like: - ```yaml scalarManager: refreshInterval: 60 # one minute ``` 1. Set the service type to access Scalar Manager. The default value is `ClusterIP`, but if we access using the `minikube tunnel` command or some load balancer, we can set it as `LoadBalancer`. - ```yaml service: type: LoadBalancer @@ -119,13 +112,11 @@ We will deploy the following components on a Kubernetes cluster as follows. ## Step 3. Deploy `scalar-manager` 1. Create a secret resource `reg-docker-secrets` to pull the Scalar Manager container image from GitHub Packages. - ```console kubectl create secret docker-registry reg-docker-secrets --docker-server=ghcr.io --docker-username= --docker-password= ``` 1. Deploy the `scalar-manager` Helm Chart. - ```console helm install scalar-manager scalar-labs/scalar-manager -f scalar-manager-custom-values.yaml ``` @@ -135,7 +126,6 @@ We will deploy the following components on a Kubernetes cluster as follows. ### If you use minikube 1. To expose Scalar Manager's service resource as your `localhost (127.0.0.1)`, open another terminal, and run the `minikube tunnel` command. - ```console minikube tunnel ``` @@ -148,7 +138,6 @@ If you use a Kubernetes cluster other than minikube, you need to access the Load ## Step 5. Delete Scalar Manager 1. Uninstall `scalar-manager` - ```console helm uninstall scalar-manager ``` diff --git a/docs/3.8/helm-charts/getting-started-scalardb-analytics-postgresql.md b/docs/3.8/helm-charts/getting-started-scalardb-analytics-postgresql.md index 1e2fe8fa..c9358808 100644 --- a/docs/3.8/helm-charts/getting-started-scalardb-analytics-postgresql.md +++ b/docs/3.8/helm-charts/getting-started-scalardb-analytics-postgresql.md @@ -33,7 +33,7 @@ You will deploy the following components in a Kubernetes cluster: ## Step 1. Start a Kubernetes cluster -First, you need to prepare a Kubernetes cluster. If you're using a **minikube** environment, please refer to the [Getting Started with Scalar Helm Charts](./getting-started-scalar-helm-charts.md). If you have already started a Kubernetes cluster, you can skip this step. +First, you need to prepare a Kubernetes cluster. If you're using a **minikube** environment, please refer to the [Getting Started with Scalar Helm Charts](getting-started-scalar-helm-charts.md). If you have already started a Kubernetes cluster, you can skip this step. ## Step 2. Start MySQL and PostgreSQL pods diff --git a/docs/3.8/helm-charts/getting-started-scalardb.md b/docs/3.8/helm-charts/getting-started-scalardb.md index 773ca553..b90f2d61 100644 --- a/docs/3.8/helm-charts/getting-started-scalardb.md +++ b/docs/3.8/helm-charts/getting-started-scalardb.md @@ -43,7 +43,7 @@ We will deploy the following components on a Kubernetes cluster as follows. ## 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](./getting-started-scalar-helm-charts.md). If you have already started a Kubernetes cluster, you can skip this step. +First, you need to prepare a Kubernetes cluster. If you use a **minikube** environment, please refer to the [Getting Started with Scalar Helm Charts](getting-started-scalar-helm-charts.md). If you have already started a Kubernetes cluster, you can skip this step. ## Step 2. Start a PostgreSQL container @@ -261,7 +261,7 @@ The following explains the minimum steps. If you want to know more details about git branch ``` [Command execution result] - + {% raw %} ```console master @@ -370,8 +370,7 @@ After completing the ScalarDB Server tests on the Kubernetes cluster, remove all ``` 1. Remove the Client container. - - ```console + ``` kubectl delete pod scalardb-client --force --grace-period 0 ``` @@ -379,6 +378,6 @@ After completing the ScalarDB Server tests on the Kubernetes cluster, remove all You can see how to get started with monitoring or logging for Scalar products in the following documents. -* [Getting Started with Helm Charts (Monitoring using Prometheus Operator)](./getting-started-monitoring.md) -* [Getting Started with Helm Charts (Logging using Loki Stack)](./getting-started-logging.md) -* [Getting Started with Helm Charts (Scalar Manager)](./getting-started-scalar-manager.md) +* [Getting Started with Helm Charts (Monitoring using Prometheus Operator)](getting-started-monitoring.md) +* [Getting Started with Helm Charts (Logging using Loki Stack)](getting-started-logging.md) +* [Getting Started with Helm Charts (Scalar Manager)](getting-started-scalar-manager.md) diff --git a/docs/3.8/helm-charts/getting-started-scalardl-auditor.md b/docs/3.8/helm-charts/getting-started-scalardl-auditor.md index 8ef9da73..1363ef33 100644 --- a/docs/3.8/helm-charts/getting-started-scalardl-auditor.md +++ b/docs/3.8/helm-charts/getting-started-scalardl-auditor.md @@ -63,7 +63,7 @@ We will deploy the following components on a Kubernetes cluster as follows. ## 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](./getting-started-scalar-helm-charts.md). If you have already started a Kubernetes cluster, you can skip this step. +First, you need to prepare a Kubernetes cluster. If you use a **minikube** environment, please refer to the [Getting Started with Scalar Helm Charts](getting-started-scalar-helm-charts.md). If you have already started a Kubernetes cluster, you can skip this step. ## Step 2. Start PostgreSQL containers @@ -72,13 +72,11 @@ ScalarDL Ledger and Auditor use some kind of database system as a backend databa You can deploy PostgreSQL on the Kubernetes cluster as follows. 1. Add the Bitnami helm repository. - ```console helm repo add bitnami https://charts.bitnami.com/bitnami ``` 1. Deploy PostgreSQL for Ledger. - ```console helm install postgresql-ledger bitnami/postgresql \ --set auth.postgresPassword=postgres \ @@ -86,7 +84,6 @@ You can deploy PostgreSQL on the Kubernetes cluster as follows. ``` 1. Deploy PostgreSQL for Auditor. - ```console helm install postgresql-auditor bitnami/postgresql \ --set auth.postgresPassword=postgres \ @@ -94,13 +91,10 @@ You can deploy PostgreSQL on the Kubernetes cluster as follows. ``` 1. Check if the PostgreSQL containers are running. - ```console kubectl get pod ``` - [Command execution result] - ```console NAME READY STATUS RESTARTS AGE postgresql-auditor-0 1/1 Running 0 11s @@ -112,7 +106,6 @@ You can deploy PostgreSQL on the Kubernetes cluster as follows. We will create some configuration files and key/certificate files locally. So, create a working directory for them. 1. Create a working directory. - ```console mkdir -p ~/scalardl-test/certs/ ``` @@ -122,13 +115,11 @@ We will create some configuration files and key/certificate files locally. So, c Note: In this guide, we will use self-sign certificates for the test. However, it is strongly recommended that these certificates NOT be used in production. 1. Change the working directory to `~/scalardl-test/certs/` directory. - ```console cd ~/scalardl-test/certs/ ``` 1. Create a JSON file that includes Ledger information. - ```console cat << 'EOF' > ~/scalardl-test/certs/ledger.json { @@ -152,7 +143,6 @@ Note: In this guide, we will use self-sign certificates for the test. However, i ``` 1. Create a JSON file that includes Auditor information. - ```console cat << 'EOF' > ~/scalardl-test/certs/auditor.json { @@ -176,7 +166,6 @@ Note: In this guide, we will use self-sign certificates for the test. However, i ``` 1. Create a JSON file that includes Client information. - ```console cat << 'EOF' > ~/scalardl-test/certs/client.json { @@ -200,31 +189,25 @@ Note: In this guide, we will use self-sign certificates for the test. However, i ``` 1. Create key/certificate files for the Ledger. - ```console cfssl selfsign "" ./ledger.json | cfssljson -bare ledger ``` 1. Create key/certificate files for the Auditor. - ```console cfssl selfsign "" ./auditor.json | cfssljson -bare auditor ``` 1. Create key/certificate files for the Client. - ```console cfssl selfsign "" ./client.json | cfssljson -bare client ``` 1. Confirm key/certificate files are created. - ```console ls -1 ``` - [Command execution result] - ```console auditor-key.pem auditor.csr @@ -246,29 +229,24 @@ We will deploy two ScalarDL Schema Loader pods on the Kubernetes cluster using H The ScalarDL Schema Loader will create the DB schemas for ScalarDL Ledger and Auditor in PostgreSQL. 1. Change the working directory to `~/scalardl-test/`. - ```console cd ~/scalardl-test/ ``` 1. Add the Scalar helm repository. - ```console helm repo add scalar-labs https://scalar-labs.github.io/helm-charts ``` 1. Create a secret resource to pull the ScalarDL container images from AWS/Azure Marketplace. * AWS Marketplace - ```console 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 - ```console kubectl create secret docker-registry reg-acr-secrets \ --docker-server= \ @@ -277,7 +255,7 @@ The ScalarDL Schema Loader will create the DB schemas for ScalarDL Ledger and Au ``` Please refer to the following documents for more details. - + * [How to install Scalar products through AWS Marketplace](https://github.com/scalar-labs/scalar-kubernetes/blob/master/docs/AwsMarketplaceGuide.md) * [How to install Scalar products through Azure Marketplace](https://github.com/scalar-labs/scalar-kubernetes/blob/master/docs/AzureMarketplaceGuide.md) @@ -372,7 +350,6 @@ The ScalarDL Schema Loader will create the DB schemas for ScalarDL Ledger and Au {% endraw %} 1. Create a secret resource that includes a username and password for PostgreSQL for Ledger. - ```console kubectl create secret generic ledger-credentials-secret \ --from-literal=SCALAR_DL_LEDGER_POSTGRES_USERNAME=postgres \ @@ -380,7 +357,6 @@ The ScalarDL Schema Loader will create the DB schemas for ScalarDL Ledger and Au ``` 1. Create a secret resource that includes a username and password for PostgreSQL for Auditor. - ```console kubectl create secret generic auditor-credentials-secret \ --from-literal=SCALAR_DL_AUDITOR_POSTGRES_USERNAME=postgres \ @@ -388,25 +364,20 @@ The ScalarDL Schema Loader will create the DB schemas for ScalarDL Ledger and Au ``` 1. Deploy the ScalarDL Schema Loader for Ledger. - ```console helm install schema-loader-ledger scalar-labs/schema-loading -f ./schema-loader-ledger-custom-values.yaml ``` 1. Deploy the ScalarDL Schema Loader for Auditor. - ```console helm install schema-loader-auditor scalar-labs/schema-loading -f ./schema-loader-auditor-custom-values.yaml ``` 1. Check if the ScalarDL Schema Loader pods are deployed and completed. - ```console kubectl get pod ``` - [Command execution result] - ```console NAME READY STATUS RESTARTS AGE postgresql-auditor-0 1/1 Running 0 2m56s @@ -414,7 +385,6 @@ The ScalarDL Schema Loader will create the DB schemas for ScalarDL Ledger and Au schema-loader-auditor-schema-loading-dvc5r 0/1 Completed 0 6s schema-loader-ledger-schema-loading-mtllb 0/1 Completed 0 10s ``` - If the ScalarDL Schema Loader pods are **ContainerCreating** or **Running**, wait for the process will be completed (The STATUS will be **Completed**). ## Step 6. Deploy ScalarDL Ledger and Auditor on the Kubernetes cluster using Helm Charts @@ -577,37 +547,30 @@ The ScalarDL Schema Loader will create the DB schemas for ScalarDL Ledger and Au {% endraw %} 1. Create secret resource `ledger-keys`. - ```console kubectl create secret generic ledger-keys --from-file=certificate=./certs/ledger.pem --from-file=private-key=./certs/ledger-key.pem ``` 1. Create secret resource `auditor-keys`. - ```console kubectl create secret generic auditor-keys --from-file=certificate=./certs/auditor.pem --from-file=private-key=./certs/auditor-key.pem ``` 1. Deploy the ScalarDL Ledger. - ```console helm install scalardl-ledger scalar-labs/scalardl -f ./scalardl-ledger-custom-values.yaml ``` 1. Deploy the ScalarDL Auditor. - ```console helm install scalardl-auditor scalar-labs/scalardl-audit -f ./scalardl-auditor-custom-values.yaml ``` 1. Check if the ScalarDL Ledger and Auditor pods are deployed. - ```console kubectl get pod ``` - [Command execution result] - ```console NAME READY STATUS RESTARTS AGE postgresql-auditor-0 1/1 Running 0 14m @@ -627,17 +590,13 @@ The ScalarDL Schema Loader will create the DB schemas for ScalarDL Ledger and Au schema-loader-auditor-schema-loading-dvc5r 0/1 Completed 0 11m schema-loader-ledger-schema-loading-mtllb 0/1 Completed 0 11m ``` - If the ScalarDL Ledger and Auditor pods are deployed properly, you can see the STATUS are **Running**. 1. Check if the ScalarDL Ledger and Auditor services are deployed. - ```console kubectl get svc ``` - [Command execution result] - ```console NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE kubernetes ClusterIP 10.96.0.1 443/TCP 47d @@ -654,7 +613,6 @@ The ScalarDL Schema Loader will create the DB schemas for ScalarDL Ledger and Au scalardl-ledger-headless ClusterIP None 50051/TCP,50053/TCP,50052/TCP 61s scalardl-ledger-metrics ClusterIP 10.99.122.106 8080/TCP 61s ``` - If the ScalarDL Ledger and Auditor services are deployed properly, you can see private IP addresses in the CLUSTER-IP column. (Note: `scalardl-ledger-headless` and `scalardl-auditor-headless` have no CLUSTER-IP.) ## Step 7. Start a Client container @@ -662,13 +620,11 @@ The ScalarDL Schema Loader will create the DB schemas for ScalarDL Ledger and Au We will use certificate files in a Client container. So, we create a secret resource and mount it to a Client container. 1. Create secret resource `client-keys`. - - ```console + ``` kubectl create secret generic client-keys --from-file=certificate=./certs/client.pem --from-file=private-key=./certs/client-key.pem ``` 1. Start a Client container on the Kubernetes cluster. - ```console cat << 'EOF' | kubectl apply -f - apiVersion: v1 @@ -706,13 +662,10 @@ We will use certificate files in a Client container. So, we create a secret reso ``` 1. Check if the Client container is running. - ```console kubectl get pod scalardl-client ``` - [Command execution result] - ```console NAME READY STATUS RESTARTS AGE scalardl-client 1/1 Running 0 4s @@ -727,82 +680,65 @@ The following explains the minimum steps. If you want to know more details about When you use Auditor, you need to register the certificate for the Ledger and Auditor before starting the client application. Ledger needs to register its certificate to Auditor, and Auditor needs to register its certificate to Ledger. 1. Run bash in the Client container. - ```console kubectl exec -it scalardl-client -- bash ``` - After this step, run each command in the Client container. 1. Install the git, curl and unzip commands in the Client container. - ```console apt update && apt install -y git curl unzip ``` 1. Clone ScalarDL Java Client SDK git repository. - ```console git clone https://github.com/scalar-labs/scalardl-java-client-sdk.git ``` 1. Change the directory to `scalardl-java-client-sdk/`. - ```console cd scalardl-java-client-sdk/ ``` - ```console pwd ``` - [Command execution result] - ```console + /scalardl-java-client-sdk ``` 1. Change branch to arbitrary version. - ```console git checkout -b v3.6.0 refs/tags/v3.6.0 ``` - ```console git branch ``` - [Command execution result] - ```console master * v3.6.0 ``` - If you want to use another version, please specify the version (tag) you want to use. You need to use the same version of ScalarDL Ledger and ScalarDL Java Client SDK. 1. Build the sample contracts. - ```console ./gradlew assemble ``` 1. Download CLI tools of ScalarDL from [ScalarDL Java Client SDK Releases](https://github.com/scalar-labs/scalardl-java-client-sdk/releases). - ```console curl -OL https://github.com/scalar-labs/scalardl-java-client-sdk/releases/download/v3.6.0/scalardl-java-client-sdk-3.6.0.zip ``` - You need to use the same version of CLI tools and ScalarDL Ledger. 1. Unzip the `scalardl-java-client-sdk-3.6.0.zip` file. - ```console unzip ./scalardl-java-client-sdk-3.6.0.zip ``` 1. Create a configuration file (ledger.as.client.properties) to register the certificate of Ledger to Auditor. - ```console cat << 'EOF' > ledger.as.client.properties # Ledger @@ -820,7 +756,6 @@ When you use Auditor, you need to register the certificate for the Ledger and Au ``` 1. Create a configuration file (auditor.as.client.properties) to register the certificate of Auditor to Ledger. - ```console cat << 'EOF' > auditor.as.client.properties # Ledger @@ -838,7 +773,6 @@ When you use Auditor, you need to register the certificate for the Ledger and Au ``` 1. Create a configuration file (client.properties) to access ScalarDL Ledger on the Kubernetes cluster. - ```console cat << 'EOF' > client.properties # Ledger @@ -856,57 +790,46 @@ When you use Auditor, you need to register the certificate for the Ledger and Au ``` 1. Register the certificate file of Ledger. - ```console ./scalardl-java-client-sdk-3.6.0/bin/register-cert --properties ./ledger.as.client.properties ``` 1. Register the certificate file of Auditor. - ```console ./scalardl-java-client-sdk-3.6.0/bin/register-cert --properties ./auditor.as.client.properties ``` 1. Register the certificate file of client. - ```console ./scalardl-java-client-sdk-3.6.0/bin/register-cert --properties ./client.properties ``` 1. Register the sample contract `StateUpdater`. - ```console ./scalardl-java-client-sdk-3.6.0/bin/register-contract --properties ./client.properties --contract-id StateUpdater --contract-binary-name com.org1.contract.StateUpdater --contract-class-file ./build/classes/java/main/com/org1/contract/StateUpdater.class ``` 1. Register the sample contract `StateReader`. - ```console ./scalardl-java-client-sdk-3.6.0/bin/register-contract --properties ./client.properties --contract-id StateReader --contract-binary-name com.org1.contract.StateReader --contract-class-file ./build/classes/java/main/com/org1/contract/StateReader.class ``` 1. Register the contract `ValdateLedger` to execute a validate request. - ```console ./scalardl-java-client-sdk-3.6.0/bin/register-contract --properties ./client.properties --contract-id validate-ledger --contract-binary-name com.scalar.dl.client.contract.ValidateLedger --contract-class-file ./build/classes/java/main/com/scalar/dl/client/contract/ValidateLedger.class ``` 1. Execute the contract `StateUpdater`. - ```console ./scalardl-java-client-sdk-3.6.0/bin/execute-contract --properties ./client.properties --contract-id StateUpdater --contract-argument '{"asset_id": "test_asset", "state": 3}' ``` - This sample contract updates the `state` (value) of the asset named `test_asset` to `3`. 1. Execute the contract `StateReader`. - ```console ./scalardl-java-client-sdk-3.6.0/bin/execute-contract --properties ./client.properties --contract-id StateReader --contract-argument '{"asset_id": "test_asset"}' ``` - [Command execution result] - ```console Contract result: { @@ -917,29 +840,23 @@ When you use Auditor, you need to register the certificate for the Ledger and Au } } ``` - * Reference information * If the asset data is not tampered with, the contract execution request (execute-contract command) returns `OK` as a result. * If the asset data is tampered with (e.g. the `state` value in the DB is tampered with), the contract execution request (execute-contract command) returns a value other than `OK` (e.g. `INCONSISTENT_STATES`) as a result, like the following. [Command execution result (If the asset data is tampered with)] - ```console { "status_code" : "INCONSISTENT_STATES", "error_message" : "The results from Ledger and Auditor don't match" } ``` - * In this way, the ScalarDL can detect data tampering. 1. Execute a validation request for the asset. - ```console ./scalardl-java-client-sdk-3.6.0/bin/validate-ledger --properties ./client.properties --asset-id "test_asset" ``` - [Command execution result] - ```console { "status_code" : "OK", @@ -959,19 +876,16 @@ When you use Auditor, you need to register the certificate for the Ledger and Au } } ``` - * Reference information * If the asset data is not tampered with, the validation request (validate-ledger command) returns `OK` as a result. * If the asset data is tampered with (e.g. the `state` value in the DB is tampered with), the validation request (validate-ledger command) returns a value other than `OK` (e.g. `INVALID_OUTPUT`) as a result, like the following. [Command execution result (If the asset data is tampered with)] - ```console { "status_code" : "INCONSISTENT_STATES", "error_message" : "The results from Ledger and Auditor don't match" } ``` - * In this way, the ScalarDL Ledger can detect data tampering. ## Step 9. Delete all resources @@ -979,23 +893,19 @@ When you use Auditor, you need to register the certificate for the Ledger and Au After completing the ScalarDL Ledger tests on the Kubernetes cluster, remove all resources. 1. Uninstall ScalarDL Ledger, ScalarDL Schema Loader, and PostgreSQL. - ```console helm uninstall scalardl-ledger schema-loader-ledger postgresql-ledger scalardl-auditor schema-loader-auditor postgresql-auditor ``` 1. Remove the Client container. - ``` kubectl delete pod scalardl-client --force --grace-period 0 ``` 1. Remove the working directory and sample files (configuration file, key, and certificate). - ```console cd ~ ``` - ```console rm -rf ~/scalardl-test/ ``` @@ -1004,6 +914,6 @@ After completing the ScalarDL Ledger tests on the Kubernetes cluster, remove all You can see how to get started with monitoring or logging for Scalar products in the following documents. -* [Getting Started with Helm Charts (Monitoring using Prometheus Operator)](./getting-started-monitoring.md) -* [Getting Started with Helm Charts (Logging using Loki Stack)](./getting-started-logging.md) -* [Getting Started with Helm Charts (Scalar Manager)](./getting-started-scalar-manager.md) +* [Getting Started with Helm Charts (Monitoring using Prometheus Operator)](getting-started-monitoring.md) +* [Getting Started with Helm Charts (Logging using Loki Stack)](getting-started-logging.md) +* [Getting Started with Helm Charts (Scalar Manager)](getting-started-scalar-manager.md) diff --git a/docs/3.8/helm-charts/getting-started-scalardl-ledger.md b/docs/3.8/helm-charts/getting-started-scalardl-ledger.md index 59715b2b..1110df28 100644 --- a/docs/3.8/helm-charts/getting-started-scalardl-ledger.md +++ b/docs/3.8/helm-charts/getting-started-scalardl-ledger.md @@ -45,7 +45,7 @@ We will deploy the following components on a Kubernetes cluster as follows. ## 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](./getting-started-scalar-helm-charts.md). If you have already started a Kubernetes cluster, you can skip this step. +First, you need to prepare a Kubernetes cluster. If you use a **minikube** environment, please refer to the [Getting Started with Scalar Helm Charts](getting-started-scalar-helm-charts.md). If you have already started a Kubernetes cluster, you can skip this step. ## Step 2. Start a PostgreSQL container @@ -54,13 +54,11 @@ ScalarDL Ledger uses some kind of database system as a backend database. In this You can deploy PostgreSQL on the Kubernetes cluster as follows. 1. Add the Bitnami helm repository. - ```console helm repo add bitnami https://charts.bitnami.com/bitnami ``` 1. Deploy PostgreSQL. - ```console helm install postgresql-ledger bitnami/postgresql \ --set auth.postgresPassword=postgres \ @@ -68,13 +66,10 @@ You can deploy PostgreSQL on the Kubernetes cluster as follows. ``` 1. Check if the PostgreSQL container is running. - ```console kubectl get pod ``` - [Command execution result] - ```console NAME READY STATUS RESTARTS AGE postgresql-ledger-0 1/1 Running 0 11s @@ -85,7 +80,6 @@ You can deploy PostgreSQL on the Kubernetes cluster as follows. We will create some configuration files and key/certificate files locally. So, create a working directory for them. 1. Create a working directory. - ```console mkdir -p ~/scalardl-test/certs/ ``` @@ -95,13 +89,11 @@ We will create some configuration files and key/certificate files locally. So, c Note: In this guide, we will use self-sign certificates for the test. However, it is strongly recommended that these certificates NOT be used in production. 1. Change the working directory to `~/scalardl-test/certs/` directory. - ```console cd ~/scalardl-test/certs/ ``` 1. Create a JSON file that includes Ledger information. - ```console cat << 'EOF' > ~/scalardl-test/certs/ledger.json { @@ -125,7 +117,6 @@ Note: In this guide, we will use self-sign certificates for the test. However, i ``` 1. Create a JSON file that includes Client information. - ```console cat << 'EOF' > ~/scalardl-test/certs/client.json { @@ -149,25 +140,20 @@ Note: In this guide, we will use self-sign certificates for the test. However, i ``` 1. Create key/certificate files for the Ledger. - ```console cfssl selfsign "" ./ledger.json | cfssljson -bare ledger ``` 1. Create key/certificate files for the Client. - ```console cfssl selfsign "" ./client.json | cfssljson -bare client ``` 1. Confirm key/certificate files are created. - ```console ls -1 ``` - [Command execution result] - ```console client-key.pem client.csr @@ -185,29 +171,24 @@ We will deploy a ScalarDL Schema Loader on the Kubernetes cluster using Helm Cha The ScalarDL Schema Loader will create the DB schemas for ScalarDL Ledger in PostgreSQL. 1. Change the working directory to `~/scalardl-test/`. - ```console cd ~/scalardl-test/ ``` 1. Add the Scalar helm repository. - ```console helm repo add scalar-labs https://scalar-labs.github.io/helm-charts ``` 1. Create a secret resource to pull the ScalarDL container images from AWS/Azure Marketplace. * AWS Marketplace - ```console 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 - ```console kubectl create secret docker-registry reg-acr-secrets \ --docker-server= \ @@ -242,6 +223,7 @@ The ScalarDL Schema Loader will create the DB schemas for ScalarDL Ledger in Pos EOF ``` {% endraw %} + * Azure Marketplace {% raw %} @@ -265,7 +247,6 @@ The ScalarDL Schema Loader will create the DB schemas for ScalarDL Ledger in Pos {% endraw %} 1. Create a secret resource that includes a username and password for PostgreSQL. - ```console kubectl create secret generic ledger-credentials-secret \ --from-literal=SCALAR_DL_LEDGER_POSTGRES_USERNAME=postgres \ @@ -273,25 +254,20 @@ The ScalarDL Schema Loader will create the DB schemas for ScalarDL Ledger in Pos ``` 1. Deploy the ScalarDL Schema Loader. - ```console helm install schema-loader-ledger scalar-labs/schema-loading -f ./schema-loader-ledger-custom-values.yaml ``` 1. Check if the ScalarDL Schema Loader pod is deployed and completed. - ```console kubectl get pod ``` - [Command execution result] - ```console NAME READY STATUS RESTARTS AGE postgresql-ledger-0 1/1 Running 0 11m schema-loader-ledger-schema-loading-46rcr 0/1 Completed 0 3s ``` - If the ScalarDL Schema Loader pod is **ContainerCreating** or **Running**, wait for the process will be completed (The STATUS will be **Completed**). ## Step 6. Deploy ScalarDL Ledger on the Kubernetes cluster using Helm Charts @@ -374,25 +350,20 @@ The ScalarDL Schema Loader will create the DB schemas for ScalarDL Ledger in Pos {% endraw %} 1. Create secret resource `ledger-keys`. - ```console kubectl create secret generic ledger-keys --from-file=private-key=./certs/ledger-key.pem ``` 1. Deploy the ScalarDL Ledger. - ```console helm install scalardl-ledger scalar-labs/scalardl -f ./scalardl-ledger-custom-values.yaml ``` 1. Check if the ScalarDL Ledger pods are deployed. - ```console kubectl get pod ``` - [Command execution result] - ```console NAME READY STATUS RESTARTS AGE postgresql-ledger-0 1/1 Running 0 14m @@ -404,17 +375,13 @@ The ScalarDL Schema Loader will create the DB schemas for ScalarDL Ledger in Pos scalardl-ledger-ledger-9bdf7f8bd-9tw5x 1/1 Running 0 52s schema-loader-ledger-schema-loading-46rcr 0/1 Completed 0 3m38s ``` - If the ScalarDL Ledger pods are deployed properly, you can see the STATUS are **Running**. 1. Check if the ScalarDL Ledger services are deployed. - ```console kubectl get svc ``` - [Command execution result] - ```console NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE kubernetes ClusterIP 10.96.0.1 443/TCP 47d @@ -425,7 +392,6 @@ The ScalarDL Schema Loader will create the DB schemas for ScalarDL Ledger in Pos scalardl-ledger-headless ClusterIP None 50051/TCP,50053/TCP,50052/TCP 83s scalardl-ledger-metrics ClusterIP 10.98.4.217 8080/TCP 83s ``` - If the ScalarDL Ledger services are deployed properly, you can see private IP addresses in the CLUSTER-IP column. (Note: `scalardl-ledger-headless` has no CLUSTER-IP.) ## Step 7. Start a Client container @@ -433,13 +399,11 @@ The ScalarDL Schema Loader will create the DB schemas for ScalarDL Ledger in Pos We will use certificate files in a Client container. So, we create a secret resource and mount it to a Client container. 1. Create secret resource `client-keys`. - - ```console + ``` kubectl create secret generic client-keys --from-file=certificate=./certs/client.pem --from-file=private-key=./certs/client-key.pem ``` 1. Start a Client container on the Kubernetes cluster. - ```console cat << 'EOF' | kubectl apply -f - apiVersion: v1 @@ -465,13 +429,10 @@ We will use certificate files in a Client container. So, we create a secret reso ``` 1. Check if the Client container is running. - ```console kubectl get pod scalardl-client ``` - [Command execution result] - ```console NAME READY STATUS RESTARTS AGE scalardl-client 1/1 Running 0 11s @@ -482,81 +443,65 @@ We will use certificate files in a Client container. So, we create a secret reso The following explains the minimum steps. If you want to know more details about ScalarDL and the contract, please refer to the [Getting Started with ScalarDL](https://github.com/scalar-labs/scalardl/blob/master/docs/getting-started.md). 1. Run bash in the Client container. - ```console kubectl exec -it scalardl-client -- bash ``` - After this step, run each command in the Client container. 1. Install the git, curl and unzip commands in the Client container. - ```console apt update && apt install -y git curl unzip ``` 1. Clone ScalarDL Java Client SDK git repository. - ```console git clone https://github.com/scalar-labs/scalardl-java-client-sdk.git ``` 1. Change the directory to `scalardl-java-client-sdk/`. - ```console cd scalardl-java-client-sdk/ ``` - ```console pwd ``` - [Command execution result] - ```console + /scalardl-java-client-sdk ``` 1. Change branch to arbitrary version. - ```console git checkout -b v3.6.0 refs/tags/v3.6.0 ``` - ```console git branch ``` - [Command execution result] ```console master * v3.6.0 ``` - If you want to use another version, please specify the version (tag) you want to use. You need to use the same version of ScalarDL Ledger and ScalarDL Java Client SDK. 1. Build the sample contracts. - ```console ./gradlew assemble ``` 1. Download CLI tools of ScalarDL from [ScalarDL Java Client SDK Releases](https://github.com/scalar-labs/scalardl-java-client-sdk/releases). - ```console curl -OL https://github.com/scalar-labs/scalardl-java-client-sdk/releases/download/v3.6.0/scalardl-java-client-sdk-3.6.0.zip ``` - You need to use the same version of CLI tools and ScalarDL Ledger. 1. Unzip the `scalardl-java-client-sdk-3.6.0.zip` file. - ```console unzip ./scalardl-java-client-sdk-3.6.0.zip ``` 1. Create a configuration file (client.properties) to access ScalarDL Ledger on the Kubernetes cluster. - ```console cat << 'EOF' > client.properties scalar.dl.client.server.host=scalardl-ledger-envoy.default.svc.cluster.local @@ -572,32 +517,26 @@ The following explains the minimum steps. If you want to know more details about ``` 1. Register the sample contract `StateUpdater`. - ```console ./scalardl-java-client-sdk-3.6.0/bin/register-contract --properties ./client.properties --contract-id StateUpdater --contract-binary-name com.org1.contract.StateUpdater --contract-class-file ./build/classes/java/main/com/org1/contract/StateUpdater.class ``` 1. Register the sample contract `StateReader`. - ```console ./scalardl-java-client-sdk-3.6.0/bin/register-contract --properties ./client.properties --contract-id StateReader --contract-binary-name com.org1.contract.StateReader --contract-class-file ./build/classes/java/main/com/org1/contract/StateReader.class ``` 1. Execute the contract `StateUpdater`. - ```console ./scalardl-java-client-sdk-3.6.0/bin/execute-contract --properties ./client.properties --contract-id StateUpdater --contract-argument '{"asset_id": "test_asset", "state": 3}' ``` This sample contract updates the `state` (value) of the asset named `test_asset` to `3`. 1. Execute the contract `StateReader`. - ```console ./scalardl-java-client-sdk-3.6.0/bin/execute-contract --properties ./client.properties --contract-id StateReader --contract-argument '{"asset_id": "test_asset"}' ``` - [Command execution result] - ```console Contract result: { @@ -610,13 +549,10 @@ The following explains the minimum steps. If you want to know more details about ``` 1. Execute a validation request for the asset. - ```console ./scalardl-java-client-sdk-3.6.0/bin/validate-ledger --properties ./client.properties --asset-id "test_asset" ``` - [Command execution result] - ```console { "status_code" : "OK", @@ -630,12 +566,10 @@ The following explains the minimum steps. If you want to know more details about "Auditor" : null } ``` - * Reference information * If the asset data is not tampered with, the validation request (validate-ledger command) returns `OK` as a result. * If the asset data is tampered with (e.g. the `state` value in the DB is tampered with), the validation request (validate-ledger command) returns a value other than `OK` (e.g. `INVALID_OUTPUT`) as a result, like the following. [Command execution result (If the asset data is tampered with)] - ```console { "status_code" : "INVALID_OUTPUT", @@ -649,7 +583,6 @@ The following explains the minimum steps. If you want to know more details about "Auditor" : null } ``` - * In this way, the ScalarDL Ledger can detect data tampering. ## Step 9. Delete all resources @@ -657,23 +590,19 @@ The following explains the minimum steps. If you want to know more details about After completing the ScalarDL Ledger tests on the Kubernetes cluster, remove all resources. 1. Uninstall ScalarDL Ledger, ScalarDL Schema Loader, and PostgreSQL. - ```console helm uninstall scalardl-ledger schema-loader-ledger postgresql-ledger ``` 1. Remove the Client container. - ``` kubectl delete pod scalardl-client --force --grace-period 0 ``` 1. Remove the working directory and sample files (configuration file, key, and certificate). - ```console cd ~ ``` - ```console rm -rf ~/scalardl-test/ ``` @@ -682,6 +611,6 @@ After completing the ScalarDL Ledger tests on the Kubernetes cluster, remove all You can see how to get started with monitoring or logging for Scalar products in the following documents. -* [Getting Started with Helm Charts (Monitoring using Prometheus Operator)](./getting-started-monitoring.md) -* [Getting Started with Helm Charts (Logging using Loki Stack)](./getting-started-logging.md) -* [Getting Started with Helm Charts (Scalar Manager)](./getting-started-scalar-manager.md) +* [Getting Started with Helm Charts (Monitoring using Prometheus Operator)](getting-started-monitoring.md) +* [Getting Started with Helm Charts (Logging using Loki Stack)](getting-started-logging.md) +* [Getting Started with Helm Charts (Scalar Manager)](getting-started-scalar-manager.md) diff --git a/docs/3.8/helm-charts/how-to-deploy-scalar-admin-for-kubernetes.md b/docs/3.8/helm-charts/how-to-deploy-scalar-admin-for-kubernetes.md index 20b9d06d..c53520d8 100644 --- a/docs/3.8/helm-charts/how-to-deploy-scalar-admin-for-kubernetes.md +++ b/docs/3.8/helm-charts/how-to-deploy-scalar-admin-for-kubernetes.md @@ -1,6 +1,6 @@ # How to deploy Scalar Admin for Kubernetes -This document explains how to deploy Scalar Admin for Kubernetes by using Scalar Helm Charts. For details on the custom values file for Scalar Admin for Kubernetes, see [Configure a custom values file for Scalar Admin for Kubernetes](./configure-custom-values-scalar-admin-for-kubernetes.md). +This document explains how to deploy Scalar Admin for Kubernetes by using Scalar Helm Charts. For details on the custom values file for Scalar Admin for Kubernetes, see [Configure a custom values file for Scalar Admin for Kubernetes](configure-custom-values-scalar-admin-for-kubernetes.md). ## Deploy Scalar Admin for Kubernetes diff --git a/docs/3.8/helm-charts/how-to-deploy-scalar-manager.md b/docs/3.8/helm-charts/how-to-deploy-scalar-manager.md index 9e592d40..6e7085bf 100644 --- a/docs/3.8/helm-charts/how-to-deploy-scalar-manager.md +++ b/docs/3.8/helm-charts/how-to-deploy-scalar-manager.md @@ -2,7 +2,7 @@ This document explains how to deploy Scalar Manager using Scalar Helm Charts. You must prepare your custom values file. Please refer to the following document for more details on the custom values file for Scalar Manager. -* [Configure a custom values file for Scalar Manager](./configure-custom-values-scalar-manager.md) +* [Configure a custom values file for Scalar Manager](configure-custom-values-scalar-manager.md) ## Deploy kube-prometheus-stack and loki-stack diff --git a/docs/3.8/helm-charts/how-to-deploy-scalar-products.md b/docs/3.8/helm-charts/how-to-deploy-scalar-products.md index 152e4bef..1b1df1dd 100644 --- a/docs/3.8/helm-charts/how-to-deploy-scalar-products.md +++ b/docs/3.8/helm-charts/how-to-deploy-scalar-products.md @@ -2,7 +2,7 @@ This document explains how to deploy Scalar products using Scalar Helm Charts. If you want to test Scalar products on your local environment using a minikube cluster, please refer to the following getting started guide. -* [Getting Started with Scalar Helm Charts](./getting-started-scalar-helm-charts.md) +* [Getting Started with Scalar Helm Charts](getting-started-scalar-helm-charts.md) ## Prerequisites @@ -37,7 +37,7 @@ You must prepare a database as a backend storage of ScalarDB/ScalarDL. You can s You must prepare your custom values file based on your environment. Please refer to the following documents for more details on how to create a custom values file. -* [Configure a custom values file for Scalar Helm Charts](./configure-custom-values-file.md) +* [Configure a custom values file for Scalar Helm Charts](configure-custom-values-file.md) ### Create a Secret resource for authentication of the container registry (Optional) @@ -50,10 +50,11 @@ If you use a Kubernetes cluster other than EKS or AKS, you need to create a Secr Please refer to the following documents for more details on how to deploy each product. -* [ScalarDB Cluster](./how-to-deploy-scalardb-cluster.md) -* [ScalarDL Ledger](./how-to-deploy-scalardl-ledger.md) -* [ScalarDL Auditor](./how-to-deploy-scalardl-auditor.md) -* [Scalar Admin for Kubernetes](./how-to-deploy-scalar-admin-for-kubernetes.md) -* [Scalar Manager](./how-to-deploy-scalar-manager.md) -* [[Deprecated] ScalarDB Server](./how-to-deploy-scalardb.md) -* [[Deprecated] ScalarDB GraphQL](./how-to-deploy-scalardb-graphql.md) +* [ScalarDB Cluster](how-to-deploy-scalardb-cluster.md) +* [ScalarDB Analytics with PostgreSQL](how-to-deploy-scalardb-analytics-postgresql.md) +* [ScalarDL Ledger](how-to-deploy-scalardl-ledger.md) +* [ScalarDL Auditor](how-to-deploy-scalardl-auditor.md) +* [Scalar Admin for Kubernetes](how-to-deploy-scalar-admin-for-kubernetes.md) +* [Scalar Manager](how-to-deploy-scalar-manager.md) +* [[Deprecated] ScalarDB Server](how-to-deploy-scalardb.md) +* [[Deprecated] ScalarDB GraphQL](how-to-deploy-scalardb-graphql.md) diff --git a/docs/3.8/helm-charts/how-to-deploy-scalardb-analytics-postgresql.md b/docs/3.8/helm-charts/how-to-deploy-scalardb-analytics-postgresql.md new file mode 100644 index 00000000..76a65a49 --- /dev/null +++ b/docs/3.8/helm-charts/how-to-deploy-scalardb-analytics-postgresql.md @@ -0,0 +1,35 @@ +# How to deploy ScalarDB Analytics with PostgreSQL + +This document explains how to deploy ScalarDB Analytics with PostgreSQL by using Scalar Helm Charts. For details on the custom values file for ScalarDB Analytics with PostgreSQL, see [Configure a custom values file for ScalarDB Analytics with PostgreSQL](configure-custom-values-scalardb-analytics-postgresql.md). + +## Prepare a secret resource + +You must create a secret resource `scalardb-analytics-postgresql-superuser-password` with the key `superuser-password` that includes a superuser password for PostgreSQL before you deploy ScalarDB Analytics with PostgreSQL. Scalar Helm Chart mounts this secret resource and sets the `POSTGRES_PASSWORD` environment variable to the value of the `superuser-password` key. + +```console +kubectl create secret generic scalardb-analytics-postgresql-superuser-password --from-literal=superuser-password= -n +``` + +## Deploy ScalarDB Analytics with PostgreSQL + +To deploy ScalarDB Analytics with PostgreSQL, run the following command, replacing the contents in the angle brackets as described: + +```console +helm install scalar-labs/scalardb-analytics-postgresql -n -f / --version +``` + +## Upgrade a ScalarDB Analytics with PostgreSQL deployment + +To upgrade a ScalarDB Analytics with PostgreSQL deployment, run the following command, replacing the contents in the angle brackets as described: + +```console +helm upgrade scalar-labs/scalardb-analytics-postgresql -n -f / --version +``` + +## Delete a ScalarDB Analytics with PostgreSQL deployment + +To delete a ScalarDB Analytics with PostgreSQL deployment, run the following command, replacing the contents in the angle brackets as described: + +```console +helm uninstall -n +``` diff --git a/docs/3.8/helm-charts/how-to-deploy-scalardb-cluster.md b/docs/3.8/helm-charts/how-to-deploy-scalardb-cluster.md index c45987a0..8c8ccfa2 100644 --- a/docs/3.8/helm-charts/how-to-deploy-scalardb-cluster.md +++ b/docs/3.8/helm-charts/how-to-deploy-scalardb-cluster.md @@ -1,6 +1,6 @@ # How to deploy ScalarDB Cluster -This document explains how to deploy ScalarDB Cluster by using Scalar Helm Charts. For details on the custom values file for ScalarDB Cluster, see [Configure a custom values file for ScalarDB Cluster](./configure-custom-values-scalardb-cluster.md). +This document explains how to deploy ScalarDB Cluster by using Scalar Helm Charts. For details on the custom values file for ScalarDB Cluster, see [Configure a custom values file for ScalarDB Cluster](configure-custom-values-scalardb-cluster.md). ## Deploy ScalarDB Cluster @@ -31,7 +31,6 @@ If you use ScalarDB Cluster with `direct-kubernetes` mode, you must: This method is necessary because the ScalarDB Cluster client library with `direct-kubernetes` mode runs the Kubernetes API from inside of your application pods to get information about the ScalarDB Cluster pods. * Role - ```yaml apiVersion: rbac.authorization.k8s.io/v1 kind: Role @@ -43,9 +42,7 @@ This method is necessary because the ScalarDB Cluster client library with `direc resources: ["endpoints"] verbs: ["get", "watch", "list"] ``` - * RoleBinding - ```yaml apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding @@ -60,9 +57,7 @@ This method is necessary because the ScalarDB Cluster client library with `direc name: scalardb-cluster-role apiGroup: rbac.authorization.k8s.io ``` - * ServiceAccount - ```yaml apiVersion: v1 kind: ServiceAccount diff --git a/docs/3.8/helm-charts/how-to-deploy-scalardb-graphql.md b/docs/3.8/helm-charts/how-to-deploy-scalardb-graphql.md index 89db3cae..d26eb300 100644 --- a/docs/3.8/helm-charts/how-to-deploy-scalardb-graphql.md +++ b/docs/3.8/helm-charts/how-to-deploy-scalardb-graphql.md @@ -3,14 +3,14 @@ {% capture notice--info %} **Note** -ScalarDB GraphQL Server is now deprecated. Please use [ScalarDB Cluster](./how-to-deploy-scalardb-cluster.md) instead. +ScalarDB GraphQL Server is now deprecated. Please use [ScalarDB Cluster](how-to-deploy-scalardb-cluster.md) instead. {% endcapture %}
{{ notice--info | markdownify }}
This document explains how to deploy ScalarDB GraphQL using Scalar Helm Charts. You must prepare your custom values file. Please refer to the following document for more details on the custom values file for ScalarDB GraphQL. -* [[Deprecated] Configure a custom values file for ScalarDB GraphQL](./configure-custom-values-scalardb-graphql.md) +* [[Deprecated] Configure a custom values file for ScalarDB GraphQL](configure-custom-values-scalardb-graphql.md) ## Deploy ScalarDB Server (recommended option) @@ -20,7 +20,7 @@ When you deploy ScalarDB GraphQL, it is recommended to deploy ScalarDB Server be [Client] ---> [ScalarDB GraphQL] ---> [ScalarDB Server] ---> [Backend databases] ``` -Please deploy ScalarDB Server before you deploy ScalarDB GraphQL according to the document [How to deploy ScalarDB Server](./how-to-deploy-scalardb.md). +Please deploy ScalarDB Server before you deploy ScalarDB GraphQL according to the document [How to deploy ScalarDB Server](how-to-deploy-scalardb.md). ## Deploy ScalarDB GraphQL diff --git a/docs/3.8/helm-charts/how-to-deploy-scalardb.md b/docs/3.8/helm-charts/how-to-deploy-scalardb.md index 8482477d..3b883b89 100644 --- a/docs/3.8/helm-charts/how-to-deploy-scalardb.md +++ b/docs/3.8/helm-charts/how-to-deploy-scalardb.md @@ -3,14 +3,14 @@ {% capture notice--info %} **Note** -ScalarDB Server is now deprecated. Please use [ScalarDB Cluster](./how-to-deploy-scalardb-cluster.md) instead. +ScalarDB Server is now deprecated. Please use [ScalarDB Cluster](how-to-deploy-scalardb-cluster.md) instead. {% endcapture %}
{{ notice--info | markdownify }}
This document explains how to deploy ScalarDB Server using Scalar Helm Charts. You must prepare your custom values file. Please refer to the following document for more details on the custom values file for ScalarDB Server. -* [[Deprecated] Configure a custom values file for ScalarDB Server](./configure-custom-values-scalardb.md) +* [[Deprecated] Configure a custom values file for ScalarDB Server](configure-custom-values-scalardb.md) ## Deploy ScalarDB Server diff --git a/docs/3.8/helm-charts/how-to-deploy-scalardl-auditor.md b/docs/3.8/helm-charts/how-to-deploy-scalardl-auditor.md index 085d0f09..82944872 100644 --- a/docs/3.8/helm-charts/how-to-deploy-scalardl-auditor.md +++ b/docs/3.8/helm-charts/how-to-deploy-scalardl-auditor.md @@ -2,14 +2,14 @@ This document explains how to deploy ScalarDL Auditor using Scalar Helm Charts. You must prepare your custom values file. Please refer to the following document for more details on the custom values file for ScalarDL Auditor and ScalarDL Schema Loader. -* [Configure a custom values file for ScalarDL Auditor](./configure-custom-values-scalardl-auditor.md) -* [Configure a custom values file for ScalarDL Schema Loader](./configure-custom-values-scalardl-schema-loader.md) +* [Configure a custom values file for ScalarDL Auditor](configure-custom-values-scalardl-auditor.md) +* [Configure a custom values file for ScalarDL Schema Loader](configure-custom-values-scalardl-schema-loader.md) ## Prepare a private key file and a certificate file When you deploy ScalarDL Auditor, you must create a Secrete resource to mount the private key file and the certificate file on the ScalarDL Auditor pods. -For more details on how to mount the key and certificate files on the ScalarDL pods, refer to [Mount key and certificate files on a pod in ScalarDL Helm Charts](./mount-files-or-volumes-on-scalar-pods.md#mount-key-and-certificate-files-on-a-pod-in-scalardl-helm-charts). +For more details on how to mount the key and certificate files on the ScalarDL pods, refer to [Mount key and certificate files on a pod in ScalarDL Helm Charts](mount-files-or-volumes-on-scalar-pods.md#mount-key-and-certificate-files-on-a-pod-in-scalardl-helm-charts). ## Create schemas for ScalarDL Auditor (Deploy ScalarDL Schema Loader) diff --git a/docs/3.8/helm-charts/how-to-deploy-scalardl-ledger.md b/docs/3.8/helm-charts/how-to-deploy-scalardl-ledger.md index 0ae71db7..865adb36 100644 --- a/docs/3.8/helm-charts/how-to-deploy-scalardl-ledger.md +++ b/docs/3.8/helm-charts/how-to-deploy-scalardl-ledger.md @@ -2,8 +2,8 @@ This document explains how to deploy ScalarDL Ledger using Scalar Helm Charts. You must prepare your custom values file. Please refer to the following document for more details on the custom values file for ScalarDL Ledger and ScalarDL Schema Loader. -* [Configure a custom values file for ScalarDL Ledger](./configure-custom-values-scalardl-ledger.md) -* [Configure a custom values file for ScalarDL Schema Loader](./configure-custom-values-scalardl-schema-loader.md) +* [Configure a custom values file for ScalarDL Ledger](configure-custom-values-scalardl-ledger.md) +* [Configure a custom values file for ScalarDL Schema Loader](configure-custom-values-scalardl-schema-loader.md) ## Prepare a private key file (optional / it is necessary if you use ScalarDL Auditor) @@ -11,7 +11,7 @@ If you use the [asset proofs](https://github.com/scalar-labs/scalardl/blob/maste Please refer to the following document for more details on how to mount the key/certificate files on the ScalarDL pods. -* [Mount key and certificate files on a pod in ScalarDL Helm Charts](./mount-files-or-volumes-on-scalar-pods.md#mount-key-and-certificate-files-on-a-pod-in-scalardl-helm-charts) +* [Mount key and certificate files on a pod in ScalarDL Helm Charts](mount-files-or-volumes-on-scalar-pods.md#mount-key-and-certificate-files-on-a-pod-in-scalardl-helm-charts) ## Create schemas for ScalarDL Ledger (Deploy ScalarDL Schema Loader) diff --git a/docs/3.8/helm-charts/mount-files-or-volumes-on-scalar-pods.md b/docs/3.8/helm-charts/mount-files-or-volumes-on-scalar-pods.md index 0c5dc21d..c81106aa 100644 --- a/docs/3.8/helm-charts/mount-files-or-volumes-on-scalar-pods.md +++ b/docs/3.8/helm-charts/mount-files-or-volumes-on-scalar-pods.md @@ -1,6 +1,6 @@ # Mount any files or volumes on Scalar product pods -You can mount any files or volumes on Scalar product pods when you use ScalarDB Server, ScalarDB Cluster, or ScalarDL Helm Charts (ScalarDL Ledger and ScalarDL Auditor). +You can mount any files or volumes on Scalar product pods when you use ScalarDB Server, ScalarDB Cluster, ScalarDB Analytics with PostgreSQL, or ScalarDL Helm Charts (ScalarDL Ledger and ScalarDL Auditor). ## Mount key and certificate files on a pod in ScalarDL Helm Charts @@ -8,7 +8,6 @@ You must mount the key and certificate files to run ScalarDL Auditor. * Configuration example * ScalarDL Ledger - ```yaml ledger: ledgerProperties: | @@ -17,9 +16,7 @@ You must mount the key and certificate files to run ScalarDL Auditor. scalar.dl.ledger.auditor.enabled=true scalar.dl.ledger.proof.private_key_path=/keys/private-key ``` - * ScalarDL Auditor - ```yaml auditor: auditorProperties: | @@ -33,7 +30,6 @@ In this example, you need to mount a **private-key** and a **certificate** file 1. Set `extraVolumes` and `extraVolumeMounts` in the custom values file using the same syntax of Kubernetes manifest. You need to specify the directory name to the key `mountPath`. * Example * ScalarDL Ledger - ```yaml ledger: extraVolumes: @@ -45,9 +41,7 @@ In this example, you need to mount a **private-key** and a **certificate** file mountPath: /keys readOnly: true ``` - * ScalarDL Auditor - ```yaml auditor: extraVolumes: @@ -66,14 +60,11 @@ In this example, you need to mount a **private-key** and a **certificate** file * Example * ScalarDL Ledger - ```console kubectl create secret generic ledger-keys \ --from-file=private-key=./ledger-key.pem ``` - * ScalarDL Auditor - ```console kubectl create secret generic auditor-keys \ --from-file=private-key=./auditor-key.pem \ @@ -86,15 +77,12 @@ In this example, you need to mount a **private-key** and a **certificate** file * Example * ScalarDL Ledger - ```console $ ls -l /keys/ total 0 lrwxrwxrwx 1 root root 18 Jun 27 03:12 private-key -> ..data/private-key ``` - * ScalarDL Auditor - ```console $ ls -l /keys/ total 0 @@ -109,11 +97,11 @@ You can mount emptyDir to Scalar product pods by using the following keys in you * Keys * `scalardb.extraVolumes` / `scalardb.extraVolumeMounts` (ScalarDB Server) * `scalardbCluster.extraVolumes` / `scalardbCluster.extraVolumeMounts` (ScalarDB Cluster) + * `scalardbAnalyticsPostgreSQL.extraVolumes` / `scalardbAnalyticsPostgreSQL.extraVolumeMounts` (ScalarDB Analytics with PostgreSQL) * `ledger.extraVolumes` / `ledger.extraVolumeMounts` (ScalarDL Ledger) * `auditor.extraVolumes` / `auditor.extraVolumeMounts` (ScalarDL Auditor) * Example (ScalarDB Server) - ```yaml scalardb: extraVolumes: diff --git a/docs/3.8/helm-charts/samples/scalardb/scalardb-multi-storage-sample/README.md b/docs/3.8/helm-charts/samples/scalardb/scalardb-multi-storage-sample/README.md new file mode 100644 index 00000000..a7d2355b --- /dev/null +++ b/docs/3.8/helm-charts/samples/scalardb/scalardb-multi-storage-sample/README.md @@ -0,0 +1,182 @@ +# ScalarDB Deployment Sample on Kubernetes (Multi-Storage Transactions) + +## Version + +This sample uses the following versions of each product. + +* ScalarDB Server v3.6.0 +* ScalarDB SQL CLI v3.6.0 +* Scalar Envoy v1.2.0 +* MySQL v8.0.30 +* PostgreSQL v14.4 +* Helm Chart: scalar-labs/scalardb v2.3.0 +* Helm Chart: scalar-labs/envoy v2.0.1 +* Helm Chart: bitnami/mysql v9.2.6 +* Helm Chart: bitnami/postgresql v11.6.26 + +## Environment + +This sample creates the following environment on Kubernetes cluster. + +``` ++----------------------------------------------------------------------------------------------------------------------------------------------+ +| [Kubernetes Cluster] | +| [Pod] [Pod] [Pod] | +| | +| +-------+ +-----------------+ | +| +---> | Envoy | ---+ +---> | ScalarDB Server | ---+ +----------------+ | +| | +-------+ | | +-----------------+ | | MySQL | | +| | | | | +---> | (schema0.tbl0) | | +| +--------+ +---------+ | +-------+ | +-------------------+ | +-----------------+ | | +----------------+ | +| | Client | ---> | Service | ---+---> | Envoy | ---+---> | Service | ---+---> | ScalarDB Server | ---+---+ | +| +--------+ | (Envoy) | | +-------+ | | (ScalarDB Server) | | +-----------------+ | | +----------------+ | +| +---------+ | | +-------------------+ | | +---> | PostgreSQL | | +| | +-------+ | | +-----------------+ | | (schema1.tbl1) | | +| +---> | Envoy | ---+ +---> | ScalarDB Server | ---+ +----------------+ | +| +-------+ +-----------------+ | +| | ++----------------------------------------------------------------------------------------------------------------------------------------------+ +``` + +# Preparation + +1. Get sample files. + ```console + git clone https://github.com/scalar-labs/helm-charts.git + cd helm-charts/docs/samples/scalardb/scalardb-multi-storage-sample/ + ``` + +1. Add Helm repositories. + ```console + helm repo add bitnami https://charts.bitnami.com/bitnami + ``` + ```console + helm repo add scalar-labs https://scalar-labs.github.io/helm-charts + ``` + +1. Create a secret resource to access private container registry (GitHub Packages). + ```console + kubectl create secret docker-registry reg-docker-secrets \ + --docker-server=ghcr.io \ + --docker-username= \ + --docker-password= + ``` + +1. Deploy MySQL. + ```console + helm install mysql-scalardb bitnami/mysql \ + --set auth.rootPassword=mysql \ + --set primary.persistence.enabled=false \ + --version 9.2.6 + ``` + +1. Deploy PostgreSQL. + ```console + helm install postgresql-scalardb bitnami/postgresql \ + --set auth.postgresPassword=postgres \ + --set primary.persistence.enabled=false \ + --version 11.6.26 + ``` + +# Deploy ScalarDB Server + +1. Create a secret resource that includes DB credentials. + ```console + kubectl create secret generic scalardb-credentials-secret \ + --from-literal=SCALAR_DB_MYSQL_USERNAME=root \ + --from-literal=SCALAR_DB_MYSQL_PASSWORD=mysql \ + --from-literal=SCALAR_DB_POSTGRES_USERNAME=postgres \ + --from-literal=SCALAR_DB_POSTGRES_PASSWORD=postgres + ``` + +1. Deploy ScalarDB Server + ```console + helm install scalardb scalar-labs/scalardb \ + -f ./scalardb-server.yaml \ + --version 2.3.0 + ``` + +# Deploy Client (ScalarDB SQL CLI container) + +1. Create a configmap resource that includes `database.properties`. + ```console + kubectl create configmap database-properties \ + --from-file=./database.properties + ``` + +1. Deploy ScalarDB SQL CLI container. + ```console + kubectl apply -f ./scalardb-sql-cli.yaml + ``` + +# Run SQL using ScalarDB SQL CLI + +1. Run ScalarDB SQL CLI. + ```console + kubectl exec -it scalardb-sql-cli -- java -jar /app.jar --config /conf/database.properties + ``` + +1. Create coordinator tables. + ```sql + CREATE COORDINATOR TABLES; + ``` + +1. Create namespaces. + ```sql + CREATE NAMESPACE schema0; + ``` + ```sql + CREATE NAMESPACE schema1; + ``` + +1. Create tables. + ```sql + CREATE TABLE schema0.t0 ( + c1 INT PRIMARY KEY, + c2 INT, + c3 TEXT + ); + ``` + ```sql + CREATE TABLE schema1.t1 ( + c1 INT PRIMARY KEY, + c2 INT, + c3 TEXT + ); + ``` + +1. INSERT records. + ```sql + INSERT INTO schema0.t0 VALUES (1, 11, 'A'); + ``` + ```sql + INSERT INTO schema1.t1 VALUeS (2, 22, 'B'); + ``` + ```sql + BEGIN; + INSERT INTO schema0.t0 VALUES (3, 33, 'C'); + INSERT INTO schema1.t1 VALUeS (4, 44, 'D'); + COMMIT; + ``` + +1. SELECT all records. + ```sql + SELECT * FROM schema0.t0; + ``` + ```sql + SELECT * FROM schema1.t1; + ``` + +# Confirm the records in the backend DB (For testing only. Retrieving record from backend DB directly is NOT recommended in production environment.) + +1. SELECT records from MySQL (Backend DB 0). + ```sql + kubectl exec -it mysql-scalardb-0 -- mysql -u root -p schema0 -e "SELECT c1, c2, c3, tx_id FROM t0" + ``` + * Password is `mysql`. + +1. SELECT records from PostgreSQL (Backend DB 1). + ```sql + kubectl exec -it postgresql-scalardb-0 -- psql -U postgres -c "SELECT c1, c2, c3, tx_id FROM schema1.t1" + ``` + * Password is `postgres`. diff --git a/docs/3.8/helm-charts/samples/scalardb/scalardb-multi-storage-sample/database.properties b/docs/3.8/helm-charts/samples/scalardb/scalardb-multi-storage-sample/database.properties new file mode 100644 index 00000000..b6d19a6a --- /dev/null +++ b/docs/3.8/helm-charts/samples/scalardb/scalardb-multi-storage-sample/database.properties @@ -0,0 +1,6 @@ +scalar.db.sql.default_transaction_mode=TRANSACTION +scalar.db.sql.connection_mode=DIRECT +scalar.db.contact_points=scalardb-envoy.default.svc.cluster.local +scalar.db.contact_port=60051 +scalar.db.storage=grpc +scalar.db.transaction_manager=grpc diff --git a/docs/3.8/helm-charts/samples/scalardb/scalardb-multi-storage-sample/scalardb-server.yaml b/docs/3.8/helm-charts/samples/scalardb/scalardb-multi-storage-sample/scalardb-server.yaml new file mode 100644 index 00000000..78d072dc --- /dev/null +++ b/docs/3.8/helm-charts/samples/scalardb/scalardb-multi-storage-sample/scalardb-server.yaml @@ -0,0 +1,34 @@ +scalardb: + + databaseProperties: | + # The storage is "multi-storage" + scalar.db.storage=multi-storage + scalar.db.multi_storage.storages=storage0,storage1 + + # Storage 0 + scalar.db.multi_storage.storages.storage0.storage=jdbc + scalar.db.multi_storage.storages.storage0.contact_points=jdbc:mysql://mysql-scalardb.default.svc.cluster.local:3306/ + scalar.db.multi_storage.storages.storage0.username={{ default .Env.SCALAR_DB_MYSQL_USERNAME "" }} + scalar.db.multi_storage.storages.storage0.password={{ default .Env.SCALAR_DB_MYSQL_PASSWORD "" }} + + # Storage 1 + scalar.db.multi_storage.storages.storage1.storage=jdbc + scalar.db.multi_storage.storages.storage1.contact_points=jdbc:postgresql://postgresql-scalardb.default.svc.cluster.local:5432/postgres + scalar.db.multi_storage.storages.storage1.username={{ default .Env.SCALAR_DB_POSTGRES_USERNAME "" }} + scalar.db.multi_storage.storages.storage1.password={{ default .Env.SCALAR_DB_POSTGRES_PASSWORD "" }} + + # Define namespace mappings from a namespace name to a storage. The format is ":,..." + scalar.db.multi_storage.namespace_mapping=schema0:storage0,schema1:storage1 + + # Define the default storage that’s used if a specified table doesn’t have any table mapping + scalar.db.multi_storage.default_storage=storage1 + + secretName: "scalardb-credentials-secret" + + podSecurityPolicy: + enabled: false + +envoy: + + podSecurityPolicy: + enabled: false diff --git a/docs/3.8/helm-charts/samples/scalardb/scalardb-multi-storage-sample/scalardb-sql-cli.yaml b/docs/3.8/helm-charts/samples/scalardb/scalardb-multi-storage-sample/scalardb-sql-cli.yaml new file mode 100644 index 00000000..4890a71d --- /dev/null +++ b/docs/3.8/helm-charts/samples/scalardb/scalardb-multi-storage-sample/scalardb-sql-cli.yaml @@ -0,0 +1,21 @@ +apiVersion: v1 +kind: Pod +metadata: + name: scalardb-sql-cli +spec: + containers: + - name: scalardb-sql-cli + image: ghcr.io/scalar-labs/scalardb-sql-cli:3.6.0 + command: ['sleep'] + args: ['inf'] + volumeMounts: + - name: database-properties + mountPath: "/conf" + readOnly: true + imagePullSecrets: + - name: reg-docker-secrets + volumes: + - name: database-properties + configMap: + name: database-properties + restartPolicy: Never diff --git a/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/README.md b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/README.md new file mode 100644 index 00000000..b9d6a6bd --- /dev/null +++ b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/README.md @@ -0,0 +1,252 @@ +# ScalarDL Deployment Sample on Kubernetes (Auditor mode) + +## Version + +* ScalarDL Ledger v3.5.3 +* ScalarDL Auditor v3.5.3 +* Scalar Envoy v1.3.0 +* ScalarDL Schema Loader v3.5.0 +* PostgreSQL v14.4 +* Helm Chart: scalar-labs/scalardl v4.3.3 +* Helm Chart: scalar-labs/scalardl-audit v2.3.3 +* Helm Chart: scalar-labs/envoy v2.2.0 +* Helm Chart: scalar-labs/schema-loading v2.6.0 +* Helm Chart: bitnami/postgresql v11.6.26 + +## Environment + +This sample creates the following environment on Kubernetes cluster. + +``` ++-----------------------------------------------------------------------------------------------------------------------------+ +| [Kubernetes Cluster] | +| [Pod] [Pod] [Pod] | +| | +| +-------+ +---------+ | +| +---> | Envoy | ---+ +---> | Ledger | ---+ | +| | +-------+ | | +---------+ | | +| | | | | | +| +---------+ | +-------+ | +-----------+ | +---------+ | +---------------+ | +| +---> | Service | ---+---> | Envoy | ---+---> | Service | ---+---> | Ledger | ---+---> | PostgreSQL | | +| | | (Envoy) | | +-------+ | | (Ledger) | | +---------+ | | (For Ledger) | | +| | +---------+ | | +-----------+ | | +---------------+ | +| | | +-------+ | | +---------+ | | +| | +---> | Envoy | ---+ +---> | Ledger | ---+ | +| +--------+ | +-------+ +---------+ | +| | Client | ---+ | +| +--------+ | +-------+ +---------+ | +| | +---> | Envoy | ---+ +---> | Auditor | ---+ | +| | | +-------+ | | +---------+ | | +| | | | | | | +| | +---------+ | +-------+ | +-----------+ | +---------+ | +---------------+ | +| +---> | Service | ---+---> | Envoy | ---+---> | Service | ---+---> | Auditor | ---+---> | PostgreSQL | | +| | (Envoy) | | +-------+ | | (Auditor) | | +---------+ | | (For Auditor) | | +| +---------+ | | +-----------+ | | +---------------+ | +| | +-------+ | | +---------+ | | +| +---> | Envoy | ---+ +---> | Auditor | ---+ | +| +-------+ +---------+ | +| | ++-----------------------------------------------------------------------------------------------------------------------------+ +``` + +Note: To make Byzantine fault detection with auditing work properly, Ledger and Auditor should be deployed and managed in different administrative domains. However, for this samples, we deploy them in the same Kubernetes cluster. + +# Preparation + +1. Get sample files. + ```console + git clone https://github.com/scalar-labs/helm-charts.git + cd helm-charts/docs/samples/scalardl/scalardl-auditor-mode-sample/ + ``` + +1. Add Helm repositories. + ```console + helm repo add bitnami https://charts.bitnami.com/bitnami + ``` + ```console + helm repo add scalar-labs https://scalar-labs.github.io/helm-charts + ``` + +1. Create a secret resource to access private container registry (GitHub Packages). + ```console + kubectl create secret docker-registry reg-docker-secrets \ + --docker-server=ghcr.io \ + --docker-username= \ + --docker-password= + ``` + +1. Deploy PostgreSQL for Ledger. + ```console + helm install postgresql-ledger bitnami/postgresql \ + --set auth.postgresPassword=postgres \ + --set primary.persistence.enabled=false \ + --version 11.6.26 + ``` + +1. Deploy PostgreSQL for Auditor. + ```console + helm install postgresql-auditor bitnami/postgresql \ + --set auth.postgresPassword=postgres \ + --set primary.persistence.enabled=false \ + --version 11.6.26 + ``` + +# Deploy ScalarDL Ledger + +1. Create a secret resource that includes DB credentials. + ```console + kubectl create secret generic ledger-credentials-secret \ + --from-literal=SCALAR_DB_USERNAME=postgres \ + --from-literal=SCALAR_DB_PASSWORD=postgres + ``` + +1. Create a secret resource that includes private key file. + ```console + kubectl create secret generic ledger-key-secret \ + --from-file=ledger-key-file=./ledger-key.pem + ``` + +1. Deploy ScalarDL Schema Loader to create schema on PostgreSQL for Ledger. + ```console + helm install schema-ledger scalar-labs/schema-loading \ + -f ./schema-loader-ledger-custom-values.yaml \ + --version 2.6.0 + ``` + +1. Deploy ScalarDL Ledger. + ```console + helm install scalardl-ledger scalar-labs/scalardl \ + -f ./scalardl-ledger-custom-values.yaml \ + --version 4.3.3 + ``` + +# Deploy ScalarDL Auditor + +1. Create a secret resource that includes DB credentials. + ```console + kubectl create secret generic auditor-credentials-secret \ + --from-literal=SCALAR_DB_USERNAME=postgres \ + --from-literal=SCALAR_DB_PASSWORD=postgres + ``` + +1. Create a secret resource that includes private key and certificate file. + ```console + kubectl create secret generic auditor-key-secret \ + --from-file=auditor-key-file=./auditor-key.pem \ + --from-file=auditor-cert-file=./auditor.pem + ``` + +1. Deploy ScalarDL Schema Loader to create schema on PostgreSQL for Auditor. + ```console + helm install schema-auditor scalar-labs/schema-loading \ + -f ./schema-loader-auditor-custom-values.yaml \ + --version 2.6.0 + ``` + +1. Deploy ScalarDL Auditor. + ```console + helm install scalardl-auditor scalar-labs/scalardl-audit \ + -f ./scalardl-auditor-custom-values.yaml \ + --version 2.3.3 + ``` + +# Deploy Client + +1. Create secret resources that include each private key and certificate file. + ```console + kubectl create secret generic client-ledger-key-secret \ + --from-file=ledger-key-file=./ledger-key.pem \ + --from-file=ledger-cert-file=./ledger.pem + ``` + ```console + kubectl create secret generic client-auditor-key-secret \ + --from-file=auditor-key-file=./auditor-key.pem \ + --from-file=auditor-cert-file=./auditor.pem + ``` + ```console + kubectl create secret generic client-key-secret \ + --from-file=client-key-file=./client-key.pem \ + --from-file=client-cert-file=./client.pem + ``` + +1. Create configmap resources that include each properties file. + ```console + kubectl create configmap ledger-as-client-properties \ + --from-file=./ledger.as.client.properties + ``` + ```console + kubectl create configmap auditor-as-client-properties \ + --from-file=./auditor.as.client.properties + ``` + ```console + kubectl create configmap client-properties \ + --from-file=./client.properties + ``` + +1. Deploy client. + ```console + kubectl apply -f ./scalardl-client.yaml + ``` + +# Run sample contracts + +1. Attach to client container with bash. + ```console + kubectl exec -it scalardl-client -- bash + ``` + +1. Install some tools to build and run the sample contracts. + ```console + apt update && DEBIAN_FRONTEND="noninteractive" TZ="Etc/UTC" apt install -y git openjdk-8-jdk curl unzip + ``` + +1. Clone ScalarDL Java Client SDK git repository and build sample contracts. + ```console + git clone https://github.com/scalar-labs/scalardl-java-client-sdk.git + cd /scalardl-java-client-sdk/ + git checkout -b v3.5.3 refs/tags/v3.5.3 + ./gradlew assemble + ``` + +1. Download CLI tools of ScalarDL and unzip them. + ```console + curl -OL https://github.com/scalar-labs/scalardl-java-client-sdk/releases/download/v3.5.3/scalardl-java-client-sdk-3.5.3.zip + unzip ./scalardl-java-client-sdk-3.5.3.zip + ``` + +1. Register the certificate file of Ledger, Auditor, and client. + ```console + ./scalardl-java-client-sdk-3.5.3/bin/register-cert --properties /conf/ledger/ledger.as.client.properties + ./scalardl-java-client-sdk-3.5.3/bin/register-cert --properties /conf/auditor/auditor.as.client.properties + ./scalardl-java-client-sdk-3.5.3/bin/register-cert --properties /conf/client/client.properties + ``` + +1. Register the sample contract `StateUpdater`. + ```console + ./scalardl-java-client-sdk-3.5.3/bin/register-contract --properties /conf/client/client.properties --contract-id StateUpdater --contract-binary-name com.org1.contract.StateUpdater --contract-class-file ./build/classes/java/main/com/org1/contract/StateUpdater.class + ``` + +1. Register the sample contract `StateReader`. + ```console + ./scalardl-java-client-sdk-3.5.3/bin/register-contract --properties /conf/client/client.properties --contract-id StateReader --contract-binary-name com.org1.contract.StateReader --contract-class-file ./build/classes/java/main/com/org1/contract/StateReader.class + ``` + +1. Register the contract `ValidateLedger`. + ```console + ./scalardl-java-client-sdk-3.5.3/bin/register-contract --properties /conf/client/client.properties --contract-id validate-ledger --contract-binary-name com.scalar.dl.client.contract.ValidateLedger --contract-class-file ./build/classes/java/main/com/scalar/dl/client/contract/ValidateLedger.class + ``` + +1. Execute the contract `StateUpdater`. This sample contract updates the `state` (value) of the asset named `test_asset` to `3`. + ```console + ./scalardl-java-client-sdk-3.5.3/bin/execute-contract --properties /conf/client/client.properties --contract-id StateUpdater --contract-argument '{"asset_id": "test_asset", "state": 3}' + ``` + +1. Execute the contract `StateReader`. + ```console + ./scalardl-java-client-sdk-3.5.3/bin/execute-contract --properties /conf/client/client.properties --contract-id StateReader --contract-argument '{"asset_id": "test_asset"}' + ``` + +1. Execute a validation request of the asset. + ```console + ./scalardl-java-client-sdk-3.5.3/bin/validate-ledger --properties /conf/client/client.properties --asset-id "test_asset" + ``` diff --git a/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/auditor-key.pem b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/auditor-key.pem new file mode 100644 index 00000000..fdf4394b --- /dev/null +++ b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/auditor-key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MHcCAQEEIBGgcjRkGphY8wmL6Is+R6ccoBqEj2cz+aqtHOHAx7rMoAoGCCqGSM49 +AwEHoUQDQgAEVPyCkeLrs7N2Goo1sgEQBIna0b6Gfsk0gzEEYWVTVwkwr3izcF8Y +CGnp3sLjCjeEZJexouWZtLr86xRrRIvQ2Q== +-----END EC PRIVATE KEY----- diff --git a/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/auditor.as.client.properties b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/auditor.as.client.properties new file mode 100644 index 00000000..f0b20fa3 --- /dev/null +++ b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/auditor.as.client.properties @@ -0,0 +1,11 @@ +## Ledger +scalar.dl.client.server.host=scalardl-ledger-envoy.default.svc.cluster.local + +## Auditor +scalar.dl.client.auditor.enabled=true +scalar.dl.client.auditor.host=scalardl-auditor-envoy.default.svc.cluster.local + +## Certificate +scalar.dl.client.cert_holder_id=auditor +scalar.dl.client.cert_path=/keys/auditor/auditor-cert-file +scalar.dl.client.private_key_path=/keys/auditor/auditor-key-file diff --git a/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/auditor.pem b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/auditor.pem new file mode 100644 index 00000000..0e868953 --- /dev/null +++ b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/auditor.pem @@ -0,0 +1,14 @@ +-----BEGIN CERTIFICATE----- +MIICIjCCAcmgAwIBAgIIIWDMEu6wF74wCgYIKoZIzj0EAwIwUzELMAkGA1UEBhMC +SlAxDjAMBgNVBAgTBVRva3lvMRAwDgYDVQQHEwdTaGlidXlhMRAwDgYDVQQKEwdh +dWRpdG9yMRAwDgYDVQQDEwdhdWRpdG9yMB4XDTIyMDgxNzA2NDg1M1oXDTIyMTEx +NjEyNTM1M1owUzELMAkGA1UEBhMCSlAxDjAMBgNVBAgTBVRva3lvMRAwDgYDVQQH +EwdTaGlidXlhMRAwDgYDVQQKEwdhdWRpdG9yMRAwDgYDVQQDEwdhdWRpdG9yMFkw +EwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEVPyCkeLrs7N2Goo1sgEQBIna0b6Gfsk0 +gzEEYWVTVwkwr3izcF8YCGnp3sLjCjeEZJexouWZtLr86xRrRIvQ2aOBhjCBgzAO +BgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAwG +A1UdEwEB/wQCMAAwHQYDVR0OBBYEFC7ObqAGArmm2kkeekauAQeirMtcMCUGA1Ud +EQQeMByCC2V4YW1wbGUuY29tgg0qLmV4YW1wbGUuY29tMAoGCCqGSM49BAMCA0cA +MEQCIFMB6MLQdLFk1tj+b/uViBAcJ6b5WyQLUFYArPl8j9ExAiBDIjK7RNFa60OD +pVf4z0h5E/duuSSJ5SqMu4LPIaxxBA== +-----END CERTIFICATE----- diff --git a/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/client-key.pem b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/client-key.pem new file mode 100644 index 00000000..60155d39 --- /dev/null +++ b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/client-key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MHcCAQEEIF9jping0s3L62+fzdpF0XlOlYkRnpkCyWav8Norc9JToAoGCCqGSM49 +AwEHoUQDQgAEt8rQEx5LlOhPMmUyFWeMpZuFjor94TK39uf4RTY74anJIwsNB7XO +Y4kQ66YrYUb2OJdIbce2H7NvvUDnnPheBw== +-----END EC PRIVATE KEY----- diff --git a/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/client.pem b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/client.pem new file mode 100644 index 00000000..2100b8e5 --- /dev/null +++ b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/client.pem @@ -0,0 +1,14 @@ +-----BEGIN CERTIFICATE----- +MIICHjCCAcWgAwIBAgIIF2AiOpeLzEYwCgYIKoZIzj0EAwIwUTELMAkGA1UEBhMC +SlAxDjAMBgNVBAgTBVRva3lvMRAwDgYDVQQHEwdTaGlidXlhMQ8wDQYDVQQKEwZj +bGllbnQxDzANBgNVBAMTBmNsaWVudDAeFw0yMjA4MTcwNjQ5MDJaFw0yMjExMTYx +MjU0MDJaMFExCzAJBgNVBAYTAkpQMQ4wDAYDVQQIEwVUb2t5bzEQMA4GA1UEBxMH +U2hpYnV5YTEPMA0GA1UEChMGY2xpZW50MQ8wDQYDVQQDEwZjbGllbnQwWTATBgcq +hkjOPQIBBggqhkjOPQMBBwNCAAS3ytATHkuU6E8yZTIVZ4ylm4WOiv3hMrf25/hF +NjvhqckjCw0Htc5jiRDrpithRvY4l0htx7Yfs2+9QOec+F4Ho4GGMIGDMA4GA1Ud +DwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDAYDVR0T +AQH/BAIwADAdBgNVHQ4EFgQUXlifgdcRUHUP+IHfcmRAoJTWScYwJQYDVR0RBB4w +HIILZXhhbXBsZS5jb22CDSouZXhhbXBsZS5jb20wCgYIKoZIzj0EAwIDRwAwRAIg +AvOGsqQ/oH+DhyxZOtATulQxyDwTGRPTd9EyZttbqYwCIEXR5W0rmEVNLoOHYrZN +cfDXh/9z+w/GyuPYqv7SQ1ts +-----END CERTIFICATE----- diff --git a/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/client.properties b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/client.properties new file mode 100644 index 00000000..c5be8262 --- /dev/null +++ b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/client.properties @@ -0,0 +1,11 @@ +## Ledger +scalar.dl.client.server.host=scalardl-ledger-envoy.default.svc.cluster.local + +## Auditor +scalar.dl.client.auditor.enabled=true +scalar.dl.client.auditor.host=scalardl-auditor-envoy.default.svc.cluster.local + +## Certificate +scalar.dl.client.cert_holder_id=client +scalar.dl.client.cert_path=/keys/client/client-cert-file +scalar.dl.client.private_key_path=/keys/client/client-key-file diff --git a/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/ledger-key.pem b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/ledger-key.pem new file mode 100644 index 00000000..b5d4e5ce --- /dev/null +++ b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/ledger-key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MHcCAQEEIJ4tHcag0kfGvRsolyaFuliOvNHnz05Afd+WsTaLcE2RoAoGCCqGSM49 +AwEHoUQDQgAEXTfL/Ud0z09eO6H4xjI8s+tPvTbpOqCzwmxLbISJKd7aDds01jV8 +/ton8w/V16u8U7l7fprR3sufwdy5jH3CcA== +-----END EC PRIVATE KEY----- diff --git a/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/ledger.as.client.properties b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/ledger.as.client.properties new file mode 100644 index 00000000..ea008343 --- /dev/null +++ b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/ledger.as.client.properties @@ -0,0 +1,11 @@ +## Ledger +scalar.dl.client.server.host=scalardl-ledger-envoy.default.svc.cluster.local + +## Auditor +scalar.dl.client.auditor.enabled=true +scalar.dl.client.auditor.host=scalardl-auditor-envoy.default.svc.cluster.local + +## Certificate +scalar.dl.client.cert_holder_id=ledger +scalar.dl.client.cert_path=/keys/ledger/ledger-cert-file +scalar.dl.client.private_key_path=/keys/ledger/ledger-key-file diff --git a/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/ledger.pem b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/ledger.pem new file mode 100644 index 00000000..6a70a8b2 --- /dev/null +++ b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/ledger.pem @@ -0,0 +1,14 @@ +-----BEGIN CERTIFICATE----- +MIICHzCCAcWgAwIBAgIIMW6Jein1noUwCgYIKoZIzj0EAwIwUTELMAkGA1UEBhMC +SlAxDjAMBgNVBAgTBVRva3lvMRAwDgYDVQQHEwdTaGlidXlhMQ8wDQYDVQQKEwZs +ZWRnZXIxDzANBgNVBAMTBmxlZGdlcjAeFw0yMjA4MTcwNjQ4NDJaFw0yMjExMTYx +MjUzNDJaMFExCzAJBgNVBAYTAkpQMQ4wDAYDVQQIEwVUb2t5bzEQMA4GA1UEBxMH +U2hpYnV5YTEPMA0GA1UEChMGbGVkZ2VyMQ8wDQYDVQQDEwZsZWRnZXIwWTATBgcq +hkjOPQIBBggqhkjOPQMBBwNCAARdN8v9R3TPT147ofjGMjyz60+9Nuk6oLPCbEts +hIkp3toN2zTWNXz+2ifzD9XXq7xTuXt+mtHey5/B3LmMfcJwo4GGMIGDMA4GA1Ud +DwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDAYDVR0T +AQH/BAIwADAdBgNVHQ4EFgQUlOV8JJ07PbWffEO0DzeCjFrsGLQwJQYDVR0RBB4w +HIILZXhhbXBsZS5jb22CDSouZXhhbXBsZS5jb20wCgYIKoZIzj0EAwIDSAAwRQIg +FT8teZo1QVdqa+mRO+Wze4MaZgAKIs32bzm4IOrKzFYCIQDH1jKxxYTCVtR0fQ2D +aeqQKBvM5KJVxPVgsjtnaomaDQ== +-----END CERTIFICATE----- diff --git a/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/scalardl-auditor-custom-values.yaml b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/scalardl-auditor-custom-values.yaml new file mode 100644 index 00000000..bdea246f --- /dev/null +++ b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/scalardl-auditor-custom-values.yaml @@ -0,0 +1,26 @@ +auditor: + + auditorProperties: | + scalar.db.contact_points=jdbc:postgresql://postgresql-auditor.default.svc.cluster.local:5432/postgres + scalar.db.username={{ default .Env.SCALAR_DB_USERNAME "" }} + scalar.db.password={{ default .Env.SCALAR_DB_PASSWORD "" }} + scalar.db.storage=jdbc + scalar.dl.auditor.server.port=40051 + scalar.dl.auditor.server.privileged_port=40052 + scalar.dl.auditor.ledger.host=scalardl-ledger-envoy + scalar.dl.auditor.cert_holder_id=auditor + scalar.dl.auditor.cert_version=1 + scalar.dl.auditor.cert_path=/keys/auditor-cert-file + scalar.dl.auditor.private_key_path=/keys/auditor-key-file + + secretName: "auditor-credentials-secret" + + extraVolumes: + - name: "auditor-key-secret-volume" + secret: + secretName: "auditor-key-secret" + + extraVolumeMounts: + - name: "auditor-key-secret-volume" + mountPath: "/keys" + readOnly: true diff --git a/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/scalardl-client.yaml b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/scalardl-client.yaml new file mode 100644 index 00000000..c4b7d96a --- /dev/null +++ b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/scalardl-client.yaml @@ -0,0 +1,49 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "scalardl-client" +spec: + containers: + - name: scalardl-client + image: ubuntu:20.04 + command: ['sleep'] + args: ['inf'] + volumeMounts: + - name: "client-ledger-key-secret" + mountPath: "/keys/ledger" + readOnly: true + - name: "client-auditor-key-secret" + mountPath: "/keys/auditor" + readOnly: true + - name: "client-key-secret" + mountPath: "/keys/client" + readOnly: true + - name: ledger-as-client-properties + mountPath: "/conf/ledger" + readOnly: true + - name: auditor-as-client-properties + mountPath: "/conf/auditor" + readOnly: true + - name: client-properties + mountPath: "/conf/client" + readOnly: true + volumes: + - name: "client-ledger-key-secret" + secret: + secretName: "client-ledger-key-secret" + - name: "client-auditor-key-secret" + secret: + secretName: "client-auditor-key-secret" + - name: "client-key-secret" + secret: + secretName: "client-key-secret" + - name: ledger-as-client-properties + configMap: + name: ledger-as-client-properties + - name: auditor-as-client-properties + configMap: + name: auditor-as-client-properties + - name: client-properties + configMap: + name: client-properties + restartPolicy: Never diff --git a/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/scalardl-ledger-custom-values.yaml b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/scalardl-ledger-custom-values.yaml new file mode 100644 index 00000000..d1b6150a --- /dev/null +++ b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/scalardl-ledger-custom-values.yaml @@ -0,0 +1,22 @@ +ledger: + + ledgerProperties: | + scalar.db.contact_points=jdbc:postgresql://postgresql-ledger.default.svc.cluster.local:5432/postgres + scalar.db.username={{ default .Env.SCALAR_DB_USERNAME "" }} + scalar.db.password={{ default .Env.SCALAR_DB_PASSWORD "" }} + scalar.db.storage=jdbc + scalar.dl.ledger.proof.enabled=true + scalar.dl.ledger.auditor.enabled=true + scalar.dl.ledger.proof.private_key_path=/keys/ledger-key-file + + secretName: "ledger-credentials-secret" + + extraVolumes: + - name: "ledger-key-secret-volume" + secret: + secretName: "ledger-key-secret" + + extraVolumeMounts: + - name: "ledger-key-secret-volume" + mountPath: "/keys" + readOnly: true diff --git a/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/schema-loader-auditor-custom-values.yaml b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/schema-loader-auditor-custom-values.yaml new file mode 100644 index 00000000..c6f5d325 --- /dev/null +++ b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/schema-loader-auditor-custom-values.yaml @@ -0,0 +1,6 @@ +schemaLoading: + database: "jdbc" + contactPoints: "jdbc:postgresql://postgresql-auditor.default.svc.cluster.local:5432/postgres" + username: "postgres" + password: "postgres" + schemaType: "auditor" diff --git a/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/schema-loader-ledger-custom-values.yaml b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/schema-loader-ledger-custom-values.yaml new file mode 100644 index 00000000..58dedd25 --- /dev/null +++ b/docs/3.8/helm-charts/samples/scalardl/scalardl-auditor-mode-sample/schema-loader-ledger-custom-values.yaml @@ -0,0 +1,6 @@ +schemaLoading: + database: "jdbc" + contactPoints: "jdbc:postgresql://postgresql-ledger.default.svc.cluster.local:5432/postgres" + username: "postgres" + password: "postgres" + schemaType: "ledger" diff --git a/docs/3.8/helm-charts/use-secret-for-credentials.md b/docs/3.8/helm-charts/use-secret-for-credentials.md index 0797ddca..91fbbc20 100644 --- a/docs/3.8/helm-charts/use-secret-for-credentials.md +++ b/docs/3.8/helm-charts/use-secret-for-credentials.md @@ -32,7 +32,7 @@ SCALAR_DB_CLUSTER_MEMBERSHIP_KUBERNETES_ENDPOINT_NAME * Example * ScalarDB Server * ScalarDB Server 3.7 or earlier (Go template syntax) - + {% raw %} ```yaml scalardb: @@ -66,8 +66,17 @@ SCALAR_DB_CLUSTER_MEMBERSHIP_KUBERNETES_ENDPOINT_NAME ... ``` + * ScalarDB Analytics with PostgreSQL + ```yaml + scalardbAnalyticsPostgreSQL: + databaseProperties: | + ... + scalar.db.username=${env:SCALAR_DB_USERNAME} + scalar.db.password=${env:SCALAR_DB_PASSWORD} + ... + ``` * ScalarDL Ledger (Go template syntax) - + {% raw %} ```yaml ledger: @@ -77,7 +86,7 @@ SCALAR_DB_CLUSTER_MEMBERSHIP_KUBERNETES_ENDPOINT_NAME scalar.db.password={{ default .Env.SCALAR_DB_PASSWORD "" }} ... ``` - {% endraw %} + {% endraw %} * ScalarDL Auditor (Go template syntax) @@ -119,6 +128,7 @@ SCALAR_DB_CLUSTER_MEMBERSHIP_KUBERNETES_ENDPOINT_NAME * Keys * `scalardb.secretName` (ScalarDB Server) * `scalardbCluster.secretName` (ScalarDB Cluster) + * `scalardbAnalyticsPostgreSQL.secretName` (ScalarDB Analytics with PostgreSQL) * `ledger.secretName` (ScalarDL Ledger) * `auditor.secretName` (ScalarDL Auditor) * `schemaLoading.secretName` (ScalarDL Schema Loader) @@ -137,6 +147,11 @@ SCALAR_DB_CLUSTER_MEMBERSHIP_KUBERNETES_ENDPOINT_NAME secretName: "scalardb-cluster-credentials-secret" ``` + * ScalarDB Analytics with PostgreSQL + ```yaml + scalardbAnalyticsPostgreSQL: + secretName: scalardb-analytics-postgresql-credentials-secret + ``` * ScalarDL Ledger ```yaml @@ -177,7 +192,7 @@ SCALAR_DB_CLUSTER_MEMBERSHIP_KUBERNETES_ENDPOINT_NAME {% endraw %} * Properties file in containers - + ```properties scalar.db.contact_points=jdbc:postgresql://postgresql-scalardb.default.svc.cluster.local:5432/postgres scalar.db.username=postgres