Skip to content

Commit 0b2ed17

Browse files
committed
AUTO: Sync Kubernetes docs to ScalarDL docs site repo
1 parent a8a2047 commit 0b2ed17

File tree

77 files changed

+11398
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+11398
-0
lines changed
Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
---
2+
tags:
3+
- Enterprise Standard
4+
- Enterprise Premium
5+
displayed_sidebar: docsEnglish
6+
---
7+
8+
# Make ScalarDB or ScalarDL deployed in a Kubernetes cluster environment available from applications
9+
10+
This document explains how to make ScalarDB or ScalarDL deployed in a Kubernetes cluster environment available from applications. To make ScalarDB or ScalarDL available from applications, you can use Scalar Envoy via a Kubernetes service resource named `<HELM_RELEASE_NAME>-envoy`. You can use `<HELM_RELEASE_NAME>-envoy` in several ways, such as:
11+
12+
* Directly from inside the same Kubernetes cluster as ScalarDB or ScalarDL.
13+
* Via a load balancer from outside the Kubernetes cluster.
14+
* From a bastion server by using the `kubectl port-forward` command (for testing purposes only).
15+
16+
The resource name `<HELM_RELEASE_NAME>-envoy` is decided based on the helm release name. You can see the helm release name by running the following command:
17+
18+
```console
19+
helm list -n ns-scalar
20+
```
21+
22+
You should see the following output:
23+
24+
```console
25+
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
26+
scalardb ns-scalar 1 2023-02-09 19:31:40.527130674 +0900 JST deployed scalardb-2.5.0 3.8.0
27+
scalardl-auditor ns-scalar 1 2023-02-09 19:32:03.008986045 +0900 JST deployed scalardl-audit-2.5.1 3.7.1
28+
scalardl-ledger ns-scalar 1 2023-02-09 19:31:53.459548418 +0900 JST deployed scalardl-4.5.1 3.7.1
29+
```
30+
31+
You can also see the envoy service name `<HELM_RELEASE_NAME>-envoy` by running the following command:
32+
33+
```console
34+
kubectl get service -n ns-scalar
35+
```
36+
37+
You should see the following output:
38+
39+
```console
40+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
41+
scalardb-envoy LoadBalancer 10.99.245.143 <pending> 60051:31110/TCP 2m2s
42+
scalardb-envoy-metrics ClusterIP 10.104.56.87 <none> 9001/TCP 2m2s
43+
scalardb-headless ClusterIP None <none> 60051/TCP 2m2s
44+
scalardb-metrics ClusterIP 10.111.213.194 <none> 8080/TCP 2m2s
45+
scalardl-auditor-envoy LoadBalancer 10.111.141.43 <pending> 40051:31553/TCP,40052:31171/TCP 99s
46+
scalardl-auditor-envoy-metrics ClusterIP 10.104.245.188 <none> 9001/TCP 99s
47+
scalardl-auditor-headless ClusterIP None <none> 40051/TCP,40053/TCP,40052/TCP 99s
48+
scalardl-auditor-metrics ClusterIP 10.105.119.158 <none> 8080/TCP 99s
49+
scalardl-ledger-envoy LoadBalancer 10.96.239.167 <pending> 50051:32714/TCP,50052:30857/TCP 109s
50+
scalardl-ledger-envoy-metrics ClusterIP 10.97.204.18 <none> 9001/TCP 109s
51+
scalardl-ledger-headless ClusterIP None <none> 50051/TCP,50053/TCP,50052/TCP 109s
52+
scalardl-ledger-metrics ClusterIP 10.104.216.189 <none> 8080/TCP 109s
53+
```
54+
55+
## Run application (client) requests to ScalarDB or ScalarDL via service resources directly from inside the same Kubernetes cluster
56+
57+
If you deploy your application (client) in the same Kubernetes cluster as ScalarDB or ScalarDL (for example, if you deploy your application [client] on another node group or pool in the same Kubernetes cluster), the application can access ScalarDB or ScalarDL by using Kubernetes service resources. The format of the service resource name (FQDN) is `<HELM_RELEASE_NAME>-envoy.<NAMESPACE>.svc.cluster.local`.
58+
59+
The following are examples of ScalarDB and ScalarDL deployments on the `ns-scalar` namespace:
60+
61+
* **ScalarDB Server**
62+
```console
63+
scalardb-envoy.ns-scalar.svc.cluster.local
64+
```
65+
* **ScalarDL Ledger**
66+
```console
67+
scalardl-ledger-envoy.ns-scalar.svc.cluster.local
68+
```
69+
* **ScalarDL Auditor**
70+
```console
71+
scalardl-auditor-envoy.ns-scalar.svc.cluster.local
72+
```
73+
74+
When using the Kubernetes service resource, you must set the above FQDN in the properties file for the application (client) as follows:
75+
76+
* **Client properties file for ScalarDB Server**
77+
```properties
78+
scalar.db.contact_points=<HELM_RELEASE_NAME>-envoy.<NAMESPACE>.svc.cluster.local
79+
scalar.db.contact_port=60051
80+
scalar.db.storage=grpc
81+
scalar.db.transaction_manager=grpc
82+
```
83+
* **Client properties file for ScalarDL Ledger**
84+
```properties
85+
scalar.dl.client.server.host=<HELM_RELEASE_NAME>-envoy.<NAMESPACE>.svc.cluster.local
86+
scalar.dl.ledger.server.port=50051
87+
scalar.dl.ledger.server.privileged_port=50052
88+
```
89+
* **Client properties file for ScalarDL Ledger with ScalarDL Auditor mode enabled**
90+
```properties
91+
# Ledger
92+
scalar.dl.client.server.host=<HELM_RELEASE_NAME>-envoy.<NAMESPACE>.svc.cluster.local
93+
scalar.dl.ledger.server.port=50051
94+
scalar.dl.ledger.server.privileged_port=50052
95+
96+
# Auditor
97+
scalar.dl.client.auditor.enabled=true
98+
scalar.dl.client.auditor.host=<HELM_RELEASE_NAME>-envoy.<NAMESPACE>.svc.cluster.local
99+
scalar.dl.auditor.server.port=40051
100+
scalar.dl.auditor.server.privileged_port=40052
101+
```
102+
103+
## Run application (client) requests to ScalarDB or ScalarDL via load balancers from outside the Kubernetes cluster
104+
105+
If you deploy your application (client) in an environment outside the Kubernetes cluster for ScalarDB or ScalarDL (for example, if you deploy your application [client] on another Kubernetes cluster, container platform, or server), the application can access ScalarDB or ScalarDL by using a load balancer that each cloud service provides.
106+
107+
You can create a load balancer by setting `envoy.service.type` to `LoadBalancer` in your custom values file. After configuring the custom values file, you can use Scalar Envoy through a Kubernetes service resource by using the load balancer. You can also set the load balancer configurations by using annotations.
108+
109+
For more details on how to configure your custom values file, see [Service configurations](../helm-charts/configure-custom-values-envoy.mdx#service-configurations).
110+
111+
When using a load balancer, you must set the FQDN or IP address of the load balancer in the properties file for the application (client) as follows.
112+
113+
* **Client properties file for ScalarDB Server**
114+
```properties
115+
scalar.db.contact_points=<LOAD_BALANCER_FQDN_OR_IP_ADDRESS>
116+
scalar.db.contact_port=60051
117+
scalar.db.storage=grpc
118+
scalar.db.transaction_manager=grpc
119+
```
120+
* **Client properties file for ScalarDL Ledger**
121+
```properties
122+
scalar.dl.client.server.host=<LOAD_BALANCER_FQDN_OR_IP_ADDRESS>
123+
scalar.dl.ledger.server.port=50051
124+
scalar.dl.ledger.server.privileged_port=50052
125+
```
126+
* **Client properties file for ScalarDL Ledger with ScalarDL Auditor mode enabled**
127+
```properties
128+
# Ledger
129+
scalar.dl.client.server.host=<LOAD_BALANCER_FQDN_OR_IP_ADDRESS>
130+
scalar.dl.ledger.server.port=50051
131+
scalar.dl.ledger.server.privileged_port=50052
132+
133+
# Auditor
134+
scalar.dl.client.auditor.enabled=true
135+
scalar.dl.client.auditor.host=<LOAD_BALANCER_FQDN_OR_IP_ADDRESS>
136+
scalar.dl.auditor.server.port=40051
137+
scalar.dl.auditor.server.privileged_port=40052
138+
```
139+
140+
The concrete implementation of the load balancer and access method depend on the Kubernetes cluster. If you are using a managed Kubernetes cluster, see the following official documentation based on your cloud service provider:
141+
142+
* **Amazon Elastic Kubernetes Service (EKS)**
143+
* [Network load balancing on Amazon EKS](https://docs.aws.amazon.com/eks/latest/userguide/network-load-balancing.html)
144+
* **Azure Kubernetes Service (AKS)**
145+
* [Use a public standard load balancer in Azure Kubernetes Service (AKS)](https://learn.microsoft.com/en-us/azure/aks/load-balancer-standard)
146+
* [Use an internal load balancer with Azure Kubernetes Service (AKS)](https://learn.microsoft.com/en-us/azure/aks/internal-lb)
147+
148+
## Run client requests to ScalarDB or ScalarDL from a bastion server (for testing purposes only; not recommended in a production environment)
149+
150+
You can run client requests to ScalarDB or ScalarDL from a bastion server by running the `kubectl port-forward` command. If you create a ScalarDL Auditor mode environment, however, you must run two `kubectl port-forward` commands with different kubeconfig files from one bastion server to access two Kubernetes clusters.
151+
152+
1. **(ScalarDL Auditor mode only)** In the bastion server for ScalarDL Ledger, configure an existing kubeconfig file or add a new kubeconfig file to access the Kubernetes cluster for ScalarDL Auditor. For details on how to configure the kubeconfig file of each managed Kubernetes cluster, see [Configure kubeconfig](CreateBastionServer.mdx#configure-kubeconfig).
153+
2. Configure port forwarding to each service from the bastion server.
154+
* **ScalarDB Server**
155+
```console
156+
kubectl port-forward -n <NAMESPACE> svc/<RELEASE_NAME>-envoy 60051:60051
157+
```
158+
* **ScalarDL Ledger**
159+
```console
160+
kubectl --context <CONTEXT_IN_KUBERNETES_FOR_SCALARDL_LEDGER> port-forward -n <NAMESPACE> svc/<RELEASE_NAME>-envoy 50051:50051
161+
kubectl --context <CONTEXT_IN_KUBERNETES_FOR_SCALARDL_LEDGER> port-forward -n <NAMESPACE> svc/<RELEASE_NAME>-envoy 50052:50052
162+
```
163+
* **ScalarDL Auditor**
164+
```console
165+
kubectl --context <CONTEXT_IN_KUBERNETES_FOR_SCALARDL_AUDITOR> port-forward -n <NAMESPACE> svc/<RELEASE_NAME>-envoy 40051:40051
166+
kubectl --context <CONTEXT_IN_KUBERNETES_FOR_SCALARDL_AUDITOR> port-forward -n <NAMESPACE> svc/<RELEASE_NAME>-envoy 40052:40052
167+
```
168+
3. Configure the properties file to access ScalarDB or ScalarDL via `localhost`.
169+
* **Client properties file for ScalarDB Server**
170+
```properties
171+
scalar.db.contact_points=localhost
172+
scalar.db.contact_port=60051
173+
scalar.db.storage=grpc
174+
scalar.db.transaction_manager=grpc
175+
```
176+
* **Client properties file for ScalarDL Ledger**
177+
```properties
178+
scalar.dl.client.server.host=localhost
179+
scalar.dl.ledger.server.port=50051
180+
scalar.dl.ledger.server.privileged_port=50052
181+
```
182+
* **Client properties file for ScalarDL Ledger with ScalarDL Auditor mode enabled**
183+
```properties
184+
# Ledger
185+
scalar.dl.client.server.host=localhost
186+
scalar.dl.ledger.server.port=50051
187+
scalar.dl.ledger.server.privileged_port=50052
188+
189+
# Auditor
190+
scalar.dl.client.auditor.enabled=true
191+
scalar.dl.client.auditor.host=localhost
192+
scalar.dl.auditor.server.port=40051
193+
scalar.dl.auditor.server.privileged_port=40052
194+
```
195+

0 commit comments

Comments
 (0)