ページの先頭行へ戻る
Enterprise Postgres 15 オペレーターユーザーズガイド

5.10.2 FEPClusterカスタムリソースの定義

FEPClusterカスタムリソースのspec.fepChildCrVal.backup配下にバックアップの設定を記載します。

pgbackrestParamsにバックアップデータ格納先のオブジェクトストレージを指定します。pgbackrestParamsに設定可能な値は“2.3.5 オペレーターからのバックアップのスケジュール設定”を参照してください。

caNameに“5.10.1.1 CAファイル(ルート証明書)の格納”で作成したConfigMap名を指定します。

FEPClusterカスタムリソースの例: オブジェクトストレージのみをバックアップレポジトリに利用する場合

apiVersion: fep.fujitsu.io/v2
kind: FEPCluster
metadata:
  …
spec:
  fepChildeCrVal:
    backup: 
      pgbackrestParams: |
        repo1-type=s3
        repo1-path=/backup/cluster1
        repo1-s3-bucket= sample-bucket
        repo1-s3-endpoint=s3.ap-northeast-1.amazonaws.com
        repo1-s3-region=ap-northeast-1
        repo1-storage-ca-file=/pgbackrest/storage-certs/ca.crt
      pgbackrestKeyParams: |
        repo1-s3-key=SAMPLEKEY
        repo1-s3-key-secret=SAMPLESECRET
      caName: 
       - storage-cacert 
…

spec.fepChildeCrVal.storage.backupVolに指定した永続ボリュームとオブジェクトストレージをバックアップレポジトリに併用する場合は、オブジェクトストレージの設定を“repo2”以降に指定します。

“repo1”の定義がない場合、自動的にバックアップボリュームの格納先に永続ボリュームが指定されます。

FEPClusterカスタムリソースの例: オブジェクトストレージとPVを利用する場合

  …
spec:
  fepChildeCrVal:
    backup: 
      pgbackrestParams: |
        repo2-type=s3
        repo2-path=/backup/cluster1
        repo2-s3-bucket= sample-bucket
        repo2-s3-endpoint=s3.ap-northeast-1.amazonaws.com
        repo2-s3-region=ap-northeast-1
        repo2-storage-ca-file=/pgbackrest/storage-certs/ca.crt
      pgbackrestKeyParams: |
        repo2-s3-key=SAMPLEKEY
        repo2-s3-key-secret=SAMPLESECRET
      caName: 
       - storage-cacert
…

オブジェクトストレージGCSをバックアップリポジトリに利用する場合は下記のように指定します。

5.10.1.2 GCSリポジトリキーの格納”で作成したSecretをrepoKeySecretNameに指定します。

また、gcs-key-typeにはserviceを指定してください。

FEPClusterカスタムリソースの例: GCSをバックアップリポジトリに利用する場合

apiVersion: fep.fujitsu.io/v1
kind: FEPCluster
metadata:
  …
spec:
  fepChildeCrVal:
    backup: 
      pgbackrestParams: |
        repo1-type=gcs
        repo1-path=/backup-ct/test2
        repo1-gcs-bucket=dbaas-gcs
        repo1-gcs-endpoint=localhost
        repo1-storage-ca-file=/pgbackrest/storage-certs/ca.crt
        repo1-gcs-key=/pgbackrest/storage-keys/key.json
        repo1-gcs-key-type=service
      caName:
       - storage-cacert
      repoKeySecretName:
       - storage-key-secret
…