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).
Mount a private key file on a pod in ScalarDL Helm Charts​
You must mount the private key file to run ScalarDL Auditor.
- Configuration example
- ScalarDL Ledger
ledger:
ledgerProperties: |
...
scalar.dl.ledger.proof.enabled=true
scalar.dl.ledger.auditor.enabled=true
scalar.dl.ledger.proof.private_key_path=/keys/private-key - ScalarDL Auditor
auditor:
auditorProperties: |
...
scalar.dl.auditor.private_key_path=/keys/private-key
- ScalarDL Ledger
In this example, you need to mount a private-key file under the /keys directory in the container. And, you need to mount a file named private-key. You can use extraVolumes and extraVolumeMounts to mount this file.
-
Set
extraVolumesandextraVolumeMountsin the custom values file using the same syntax of Kubernetes manifest. You need to specify the directory name to the keymountPath.- Example
- ScalarDL Ledger
ledger:
extraVolumes:
- name: ledger-keys
secret:
secretName: ledger-keys
extraVolumeMounts:
- name: ledger-keys
mountPath: /keys
readOnly: true - ScalarDL Auditor
auditor:
extraVolumes:
- name: auditor-keys
secret:
secretName: auditor-keys
extraVolumeMounts:
- name: auditor-keys
mountPath: /keys
readOnly: true
- ScalarDL Ledger
- Example
-
Create a
Secretresource that includes a private key file.You need to specify the file name as keys of
Secret.- Example
- ScalarDL Ledger
kubectl create secret generic ledger-keys \
--from-file=private-key=./ledger-key.pem - ScalarDL Auditor
kubectl create secret generic auditor-keys \
--from-file=private-key=./auditor-key.pem
- ScalarDL Ledger
- Example
-
Deploy Scalar products with the above custom values file.
After deploying Scalar products, the private key file is mounted under the
/keysdirectory as follows.- Example
-
ScalarDL Ledger
ls -l /keys/You should see the following output:
total 0
lrwxrwxrwx 1 root root 18 Jun 27 03:12 private-key -> ..data/private-key -
ScalarDL Auditor
ls -l /keys/You should see the following output:
total 0
lrwxrwxrwx 1 root root 18 Jun 27 03:16 private-key -> ..data/private-key
-
- Example
Mount emptyDir to get a heap dump file​
You can mount emptyDir to Scalar product pods by using the following keys in your custom values file. For example, you can use this volume to get a heap dump of Scalar products.
-
Keys
scalardb.extraVolumes/scalardb.extraVolumeMounts(ScalarDB Server)scalardbCluster.extraVolumes/scalardbCluster.extraVolumeMounts(ScalarDB Cluster)ledger.extraVolumes/ledger.extraVolumeMounts(ScalarDL Ledger)auditor.extraVolumes/auditor.extraVolumeMounts(ScalarDL Auditor)
-
Example (ScalarDB Server)
scalardb:
extraVolumes:
- name: heap-dump
emptyDir: {}
extraVolumeMounts:
- name: heap-dump
mountPath: /dump
In this example, you can see the mounted volume in the ScalarDB Server pod as follows.
ls -ld /dump
You should see the following output:
drwxrwxrwx 2 root root 4096 Feb 6 07:43 /dump