メインコンテンツまでスキップ
バージョン: 3.15

Scalar 製品ポッドにファイルまたはボリュームをマウントします

ScalarDB Server、ScalarDB Cluster、ScalarDB Analytics with PostgreSQL、または ScalarDL Helm Charts (ScalarDL Ledger および ScalarDL Auditor) を使用する場合、Scalar 製品ポッドに任意のファイルまたはボリュームをマウントできます。

ScalarDL Helm Charts のポッドに秘密鍵ファイルと証明書ファイルをマウントする

ScalarDL Auditor を実行するには、秘密鍵ファイルと証明書ファイルをマウントする必要があります。

  • 構成例
    • 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
      scalar.dl.auditor.cert_path=/keys/certificate

この例では、秘密鍵 ファイルと 証明書 ファイルをコンテナ内の /keys ディレクトリにマウントする必要があります。そして、private-keycertificate という名前のファイルをマウントする必要があります。これらのファイルをマウントするには、extraVolumes および extraVolumeMounts を使用できます。

  1. Kubernetes マニフェストと同じ構文を使用して、カスタム値ファイルに extraVolumesextraVolumeMounts を設定します。mountPath キーにディレクトリ名を指定する必要があります。

      • 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
  2. キーと証明書ファイルを含む Secret リソースを作成します。

    Secret のキーにはファイル名を指定する必要があります。

      • ScalarDL Ledger
        kubectl create secret generic ledger-keys \
        --from-file=tls.key=./ledger-key.pem
      • ScalarDL Auditor
        kubectl create secret generic auditor-keys \
        --from-file=tls.key=./auditor-key.pem \
        --from-file=certificate=./auditor-cert.pem
  3. 上記のカスタム値ファイルを使用して Scalar 製品をデプロイします。

    Scalar 製品を展開した後、次のように秘密鍵ファイルと証明書ファイルが /keys ディレクトリにマウントされます。

      • ScalarDL Ledger

        ls -l /keys/

        次のような結果が表示されます:

        total 0
        lrwxrwxrwx 1 root root 18 Jun 27 03:12 private-key -> ..data/private-key
      • ScalarDL Auditor

        ls -l /keys/

        次のような結果が表示されます:

        total 0
        lrwxrwxrwx 1 root root 18 Jun 27 03:16 certificate -> ..data/certificate
        lrwxrwxrwx 1 root root 18 Jun 27 03:16 private-key -> ..data/private-key

emptyDir をマウントしてヒープダンプファイルを取得します

カスタム値ファイルで次のキーを使用して、emptyDir を Scalar 製品ポッドにマウントできます。たとえば、このボリュームを使用して、Scalar 製品のヒープダンプを取得できます。

  • キー

    • 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)
  • 例 (ScalarDB Server)

    scalardb:
    extraVolumes:
    - name: heap-dump
    emptyDir: {}
    extraVolumeMounts:
    - name: heap-dump
    mountPath: /dump

この例では、次のように ScalarDB Server ポッドにマウントされたボリュームを確認できます。

ls -ld /dump

次のような結果が表示されます:

drwxrwxrwx 2 root root 4096 Feb  6 07:43 /dump
This website uses cookies to enhance the visitor experience. By continuing to use this website, you acknowledge that you have read and understood our privacy policy and consent to the use of cookies to help improve your browsing experience and provide you with personalized content.