Skip to content

Commit f17b2bc

Browse files
AUTO: Sync Helm Charts docs to ScalarDL docs site repo (#1032)
Co-authored-by: josh-wong <joshua.wong@scalar-labs.com>
1 parent 795b30d commit f17b2bc

File tree

5 files changed

+289
-104
lines changed

5 files changed

+289
-104
lines changed

versioned_docs/version-3.11/helm-charts/configure-custom-values-envoy.mdx

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ displayed_sidebar: docsEnglish
99

1010
import Tabs from '@theme/Tabs';
1111
import TabItem from '@theme/TabItem';
12+
import CertificateManagement from '/src/components/en-us/_certificate-management.mdx';
1213

1314
This document explains how to create your custom values file for the Scalar Envoy chart. If you want to know the details of the parameters, please refer to the [README](https://github.com/scalar-labs/helm-charts/blob/main/charts/envoy/README.md) of the Scalar Envoy chart.
1415

@@ -166,50 +167,7 @@ You can enable TLS in:
166167
- Downstream connections between the client and Scalar Envoy.
167168
- Upstream connections between Scalar Envoy and Scalar products.
168169

169-
In addition, you have several options from the following two perspectives:
170-
171-
1. Management of private key and certificate files
172-
1. Manage your private key and certificate files automatically by using [cert-manager](https://cert-manager.io/docs/).
173-
- You can reduce maintenance or operation costs. For example, cert-manager automatically renews certificates before they expire and Scalar Helm Chart automatically mounts private key and certificate files on the Scalar product pods.
174-
- You cannot use a CA that cert-manager does not support. You can see the supported issuer in the [cert-manager documentation](https://cert-manager.io/docs/configuration/issuers/).
175-
1. Manage your private key and certificate files manually.
176-
- You can issue and manage your private key and certificate files by using your preferred method on your own.
177-
- You can use any certificate even if cert-manager does not support it.
178-
- You must update secret resources when certificates expire.
179-
1. Kinds of certificates
180-
1. Use a trusted CA (signed certificate by third party).
181-
- You can use trusted certificates from a third-party certificate issuer.
182-
- You can encrypt packets.
183-
- You must pay costs to issue trusted certificates.
184-
1. Use self-signed certificates.
185-
- You can reduce costs to issue certificates.
186-
- Reliability of certificates is lower than a trusted CA, but you can encrypt packets.
187-
188-
In other words, you have the following four options:
189-
190-
1. Use a self-signed CA with automatic management.
191-
1. Use a trusted CA with automatic management.
192-
1. Use a self-signed CA with manual management.
193-
1. Use a trusted CA with manual management.
194-
195-
You should consider which method you use based on your security requirements. For guidance and related documentation for each method, refer to the following decision tree:
196-
197-
```mermaid
198-
flowchart TD
199-
A[Do you want to use <br /><a href='https://cert-manager.io/docs/'>cert-manager</a> to manage your <br />private key and certificate <br />files automatically?]
200-
A -->|Yes, I want to manage my <br />certificates automatically.| B
201-
A -->|No, I want to manage my <br />certificates manually by myself.| C
202-
B[Do you want to use a <br />self-signed CA or a trusted CA?]
203-
C[Do you want to use a <br />self-signed CA or a trusted CA?]
204-
B -->|I want to use a <br />self-signed CA.| D
205-
B -->|I want to use a <br />trusted CA.| E
206-
C -->|I want to use a <br />self-signed CA.| F
207-
C -->|I want to use a <br />trusted CA.| G
208-
D[See the <a href='#use-a-self-signed-ca-with-cert-manager-to-manage-your-private-key-and-certificate-files'>Use a self-signed <br />CA with cert-manager to <br />manage your private key and <br />certificate files</a> section.]
209-
E[See the <a href='#use-a-trusted-ca-with-cert-manager-to-manage-your-private-key-and-certificate-files'>Use a trusted <br />CA with cert-manager to <br />manage private key and <br />certificate files</a> section.]
210-
F[See the <a href='#use-your-private-key-and-certificate-files'>Use your private <br />key and certificate files</a> <br />section, and use the self-signed <br />certificate you generated.]
211-
G[See the <a href='#use-your-private-key-and-certificate-files'>Use your private key <br />and certificate files</a> section, <br />and use the trusted certificate <br />generated by the third party.]
212-
```
170+
<CertificateManagement />
213171

214172
#### Enable TLS in downstream connections
215173

Lines changed: 278 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,278 @@
1+
---
2+
tags:
3+
- Enterprise Option
4+
displayed_sidebar: docsEnglish
5+
---
6+
7+
# Configure a custom values file for ScalarDB Analytics server
8+
9+
import CertificateManagement from '/src/components/en-us/_certificate-management.mdx';
10+
11+
This document explains how to create your custom values file for the ScalarDB Analytics server chart. For details on the parameters, see the [README](https://github.com/scalar-labs/helm-charts/blob/main/charts/scalardb-analytics-server/README.md) of the ScalarDB Analytics server chart.
12+
13+
## Required configurations
14+
15+
This section describes the required image, database, and service configurations.
16+
17+
### Image configurations
18+
19+
You must set `scalarDbAnalyticsServer.image.repository`. Be sure to specify the ScalarDB Analytics server container image so that you can pull the image from the container repository.
20+
21+
```yaml
22+
scalarDbAnalyticsServer:
23+
image:
24+
repository: <SCALARDB_ANALYTICS_SERVER_CONTAINER_IMAGE>
25+
```
26+
27+
### Database configurations
28+
29+
You must set `scalarDbAnalyticsServer.properties`. For details about configuring the value of this parameter, see [ScalarDB Analytics server configuration](https://scalardb.scalar-labs.com/docs/latest/scalardb-analytics/configuration).
30+
31+
```yaml
32+
scalarDbAnalyticsServer:
33+
properties: |
34+
scalar.db.analytics.server.db.url=jdbc:postgresql://localhost:5432/scalardb_analytics
35+
scalar.db.analytics.server.db.username=analytics_user
36+
scalar.db.analytics.server.db.password=your_secure_password
37+
```
38+
39+
### Service configurations
40+
41+
You must set `scalarDbAnalyticsServer.service.type` to specify the Service resource type of Kubernetes.
42+
43+
If the ScalarDB Analytics server accepts client requests from inside of the Kubernetes cluster only (for example, if you deploy your client applications on the same Kubernetes cluster as Scalar products), you can set `scalarDbAnalyticsServer.service.type` to `ClusterIP`. This configuration doesn't create any load balancers provided by cloud service providers.
44+
45+
```yaml
46+
scalarDbAnalyticsServer:
47+
service:
48+
type: ClusterIP
49+
```
50+
51+
If you want to use a load balancer provided by a cloud service provider to accept client requests from outside of the Kubernetes cluster, you need to set `scalarDbAnalyticsServer.service.type` to `LoadBalancer`.
52+
53+
```yaml
54+
scalarDbAnalyticsServer:
55+
service:
56+
type: LoadBalancer
57+
```
58+
59+
If you want to configure the load balancer via annotations, you can also set annotations to `scalarDbAnalyticsServer.service.annotations`.
60+
61+
```yaml
62+
scalarDbAnalyticsServer:
63+
service:
64+
type: LoadBalancer
65+
annotations:
66+
service.beta.kubernetes.io/aws-load-balancer-internal: "true"
67+
service.beta.kubernetes.io/aws-load-balancer-type: "nlb"
68+
```
69+
70+
## Optional configurations
71+
72+
This section describes the optional configurations.
73+
74+
### Secret configurations (recommended in production environments)
75+
76+
To use environment variables to set some properties (for example, credentials), you can use `scalarDbAnalyticsServer.secretName` to specify the Secret resource that includes some credentials.
77+
78+
For example, you can set credentials for a backend database (`scalar.db.analytics.server.db.username` and `scalar.db.analytics.server.db.password`) by using environment variables, which makes your pods more secure.
79+
80+
```yaml
81+
scalarDbAnalyticsServer:
82+
secretName: "scalardb-analytics-server-credentials-secret"
83+
```
84+
85+
:::tip
86+
87+
The ScalarDB Analytics server automatically loads configurations from specific environment variables. The naming rule for the environment variables is as follows:
88+
89+
- Capitalize all characters of the property name.
90+
- Replace periods (`.`) with underscores (`_`).
91+
92+
For example, if you want to set `scalar.db.analytics.server.db.username` and `scalar.db.analytics.server.db.password` via environment variables, you must set environment variables `SCALAR_DB_ANALYTICS_SERVER_DB_USERNAME` and `SCALAR_DB_ANALYTICS_SERVER_DB_PASSWORD`.
93+
94+
In this case, you don't need to set `scalar.db.analytics.server.db.username` and `scalar.db.analytics.server.db.password` in `scalarDbAnalyticsServer.properties`. Setting only the environment variables is enough.
95+
96+
For example, you can create such a secret resource that includes `SCALAR_DB_ANALYTICS_SERVER_DB_USERNAME` and `SCALAR_DB_ANALYTICS_SERVER_DB_PASSWORD` as follows:
97+
98+
```console
99+
kubectl create secret generic scalardb-analytics-server-credentials-secret \
100+
--from-literal=SCALAR_DB_ANALYTICS_SERVER_DB_USERNAME=analytics_user \
101+
--from-literal=SCALAR_DB_ANALYTICS_SERVER_DB_PASSWORD=your_secure_password
102+
```
103+
104+
:::
105+
106+
### SecurityContext configurations (the default value is recommended)
107+
108+
To set SecurityContext and PodSecurityContext for ScalarDB Analytics server pods, you can use `scalarDbAnalyticsServer.securityContext` and `scalarDbAnalyticsServer.podSecurityContext`.
109+
110+
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/).
111+
112+
```yaml
113+
scalarDbAnalyticsServer:
114+
podSecurityContext:
115+
seccompProfile:
116+
type: RuntimeDefault
117+
securityContext:
118+
capabilities:
119+
drop:
120+
- ALL
121+
runAsNonRoot: true
122+
allowPrivilegeEscalation: false
123+
```
124+
125+
### TLS configurations (optional based on your environment)
126+
127+
You can enable TLS in:
128+
129+
- The communications between the ScalarDB Analytics server and its client.
130+
131+
<CertificateManagement />
132+
133+
#### Enable TLS
134+
135+
You can enable TLS in all ScalarDB Analytics server connections by using the following configurations:
136+
137+
```yaml
138+
scalarDbAnalyticsServer:
139+
properties: |
140+
...(omit)...
141+
scalar.db.analytics.server.tls.enabled=true
142+
scalar.db.analytics.server.tls.cert_chain_path=/tls/scalardb-analytics-server/certs/tls.crt
143+
scalar.db.analytics.server.tls.private_key_path=/tls/scalardb-analytics-server/certs/tls.key
144+
tls:
145+
enabled: true
146+
```
147+
148+
:::note
149+
150+
Based on the specification of the private key and certificate that are created by cert-manager and the specification of this chart, you must set the fixed file path and file name when you enable the TLS feature. Please set the above file paths and file names as is for `scalar.db.analytics.server.tls.cert_chain_path` and `scalar.db.analytics.server.tls.private_key_path`.
151+
152+
:::
153+
154+
155+
##### Use your private key and certificate files
156+
157+
You can set your private key and certificate files by using the following configurations:
158+
159+
```yaml
160+
scalarDbAnalyticsServer:
161+
tls:
162+
enabled: true
163+
caRootCertSecret: "scalardb-analytics-server-tls-ca"
164+
certChainSecret: "scalardb-analytics-server-tls-cert"
165+
privateKeySecret: "scalardb-analytics-server-tls-key"
166+
```
167+
168+
In this case, you have to create secret resources that include private key and certificate files for the ScalarDB Analytics server as follows, replacing the contents in the angle brackets as described:
169+
170+
```console
171+
kubectl create secret generic scalardb-analytics-server-tls-ca --from-file=ca.crt=<PATH_TO_YOUR_CA_CERTIFICATE_FILE_FOR_SCALARDB_ANALYTICS_SERVER> -n <NAMESPACE>
172+
kubectl create secret generic scalardb-analytics-server-tls-cert --from-file=tls.crt=<PATH_TO_YOUR_CERTIFICATE_FILE_FOR_SCALARDB_ANALYTICS_SERVER> -n <NAMESPACE>
173+
kubectl create secret generic scalardb-analytics-server-tls-key --from-file=tls.key=<PATH_TO_YOUR_PRIVATE_KEY_FILE_FOR_SCALARDB_ANALYTICS_SERVER> -n <NAMESPACE>
174+
```
175+
176+
For more details on how to prepare private key and certificate files, see [How to create private key and certificate files for Scalar products](../scalar-kubernetes/HowToCreateKeyAndCertificateFiles.mdx).
177+
178+
##### Use a trusted CA with cert-manager to manage your private key and certificate files
179+
180+
You can manage your private key and certificate files with cert-manager by using the following configurations, replacing the content in the angle brackets as described:
181+
182+
:::note
183+
184+
* If you want to use cert-manager, you must deploy cert-manager and prepare the `Issuers` resource. For details, see the cert-manager documentation, [Installation](https://cert-manager.io/docs/installation/) and [Issuer Configuration](https://cert-manager.io/docs/configuration/).
185+
* By default, Scalar Helm Chart creates a `Certificate` resource that satisfies the certificate requirements of Scalar products. The default certificate configuration is recommended, but if you use a custom certificate configuration, you must satisfy the certificate requirements of Scalar products. For details, see [How to create private key and certificate files for Scalar products](../scalar-kubernetes/HowToCreateKeyAndCertificateFiles.mdx#certificate-requirements).
186+
187+
:::
188+
189+
```yaml
190+
scalarDbAnalyticsServer:
191+
tls:
192+
enabled: true
193+
certManager:
194+
enabled: true
195+
issuerRef:
196+
name: <YOUR_TRUSTED_CA>
197+
dnsNames:
198+
- server.analytics.scalardb.example.com
199+
```
200+
201+
In this case, cert-manager issues your private key and certificate files by using your trusted issuer. You don't need to mount your private key and certificate files manually.
202+
203+
##### Use a self-signed CA with cert-manager to manage your private key and certificate files
204+
205+
You can manage your private key and self-signed certificate files with cert-manager by using the following configurations:
206+
207+
:::note
208+
209+
* If you want to use cert-manager, you must deploy cert-manager. For more details on how to deploy cert-manager, see [Installation](https://cert-manager.io/docs/installation/) in the official documentation for cert-manager.
210+
* By default, Scalar Helm Chart creates a `Certificate` resource that satisfies the certificate requirements of Scalar products. The default certificate configuration is recommended, but if you use a custom certificate configuration, you must satisfy the certificate requirements of Scalar products. See [How to create private key and certificate files for Scalar products](../scalar-kubernetes/HowToCreateKeyAndCertificateFiles.mdx#certificate-requirements).
211+
212+
:::
213+
214+
```yaml
215+
scalarDbAnalyticsServer:
216+
tls:
217+
enabled: true
218+
certManager:
219+
enabled: true
220+
selfSigned:
221+
enabled: true
222+
dnsNames:
223+
- server.analytics.scalardb.example.com
224+
```
225+
226+
In this case, Scalar Helm Charts and cert-manager issue your private key and self-signed certificate files. You don't need to mount your private key and certificate files manually.
227+
228+
##### Set custom authority for TLS communications
229+
230+
You can set the custom authority for TLS communications by using `scalarDbAnalyticsServer.tls.overrideAuthority`. This value doesn't change what host is actually connected. This value is intended for testing but may safely be used outside of tests as an alternative to DNS overrides. For example, you can specify the hostname presented in the certificate chain file that you set by using `scalarDbAnalyticsServer.tls.certChainSecret`. This chart uses this value for health check requests (`startupProbe` and `livenessProbe`).
231+
232+
```yaml
233+
scalarDbAnalyticsServer:
234+
tls:
235+
enabled: true
236+
overrideAuthority: "server.analytics.scalardb.example.com"
237+
```
238+
239+
### Affinity configurations (optional based on your environment)
240+
241+
To control pod deployment by using affinity and anti-affinity in Kubernetes, you can use `scalarDbAnalyticsServer.affinity`.
242+
243+
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/).
244+
245+
```yaml
246+
scalarDbAnalyticsServer:
247+
affinity:
248+
podAntiAffinity:
249+
preferredDuringSchedulingIgnoredDuringExecution:
250+
- podAffinityTerm:
251+
labelSelector:
252+
matchExpressions:
253+
- key: app.kubernetes.io/name
254+
operator: In
255+
values:
256+
- scalardb-analytics-server
257+
- key: app.kubernetes.io/app
258+
operator: In
259+
values:
260+
- scalardb-analytics-server
261+
topologyKey: kubernetes.io/hostname
262+
weight: 50
263+
```
264+
265+
### Taint and toleration configurations (optional based on your environment)
266+
267+
If you want to control pod deployment by using the taints and tolerations in Kubernetes, you can use `scalarDbAnalyticsServer.tolerations`.
268+
269+
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/).
270+
271+
```yaml
272+
scalarDbAnalyticsServer:
273+
tolerations:
274+
- effect: NoSchedule
275+
key: scalar-labs.com/dedicated-node
276+
operator: Equal
277+
value: scalardb-analytics-server
278+
```

versioned_docs/version-3.11/helm-charts/configure-custom-values-scalardb-cluster.mdx

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ displayed_sidebar: docsEnglish
77

88
# Configure a custom values file for ScalarDB Cluster
99

10+
import CertificateManagement from '/src/components/en-us/_certificate-management.mdx';
11+
1012
This document explains how to create your custom values file for the ScalarDB Cluster chart. For details on the parameters, see the [README](https://github.com/scalar-labs/helm-charts/blob/main/charts/scalardb-cluster/README.md) of the ScalarDB Cluster chart.
1113

1214
## Required configurations
@@ -151,26 +153,7 @@ You can enable TLS in:
151153
- The communications between the ScalarDB Cluster node and clients.
152154
- The communications between all ScalarDB Cluster nodes (the cluster's internal communications).
153155

154-
In addition, you have several options for certificate management. For more details, see [TLS configurations for Envoy](./configure-custom-values-envoy.mdx#tls-configurations-optional-based-on-your-environment).
155-
156-
You should consider which method you use based on your security requirements. For guidance and related documentation for each method, refer to the following decision tree:
157-
158-
```mermaid
159-
flowchart TD
160-
A[Do you want to use <br /><a href='https://cert-manager.io/docs/'>cert-manager</a> to manage your <br />private key and certificate <br />files automatically?]
161-
A -->|Yes, I want to manage my <br />certificates automatically.| B
162-
A -->|No, I want to manage my <br />certificates manually by myself.| C
163-
B[Do you want to use a <br />self-signed CA or a trusted CA?]
164-
C[Do you want to use a <br />self-signed CA or a trusted CA?]
165-
B -->|I want to use a <br />self-signed CA.| D
166-
B -->|I want to use a <br />trusted CA.| E
167-
C -->|I want to use a <br />self-signed CA.| F
168-
C -->|I want to use a <br />trusted CA.| G
169-
D[See the <a href='#use-a-self-signed-ca-with-cert-manager-to-manage-your-private-key-and-certificate-files'>Use a self-signed <br />CA with cert-manager to <br />manage your private key and <br />certificate files</a> section.]
170-
E[See the <a href='#use-a-trusted-ca-with-cert-manager-to-manage-your-private-key-and-certificate-files'>Use a trusted <br />CA with cert-manager to <br />manage private key and <br />certificate files</a> section.]
171-
F[See the <a href='#use-your-private-key-and-certificate-files'>Use your private <br />key and certificate files</a> <br />section, and use the self-signed <br />certificate you generated.]
172-
G[See the <a href='#use-your-private-key-and-certificate-files'>Use your private key <br />and certificate files</a> section, <br />and use the trusted certificate <br />generated by the third party.]
173-
```
156+
<CertificateManagement />
174157

175158
#### Enable TLS
176159

0 commit comments

Comments
 (0)