Velero プラグイン
    • PDF

    Velero プラグイン

    • PDF

    Article Summary

    VPC環境で利用できます。

    Kubernetesのクラスタのバックアップが必要な場合、Veleroプラグインを使用します。Veleroを通じて Kubernetesオブジェクトを Object Storageに圧縮・バックアップできます。また、クラスタの PersistentVolumeに対するスナップショットを作成してクラスタのオブジェクトと PersistentVolumeを以前の状態に復元できます。使用する前に以下をご参照ください。

    • このガイドは Ubuntu 20.04 OSと Velero v1.10.3を基準に作成されました。
    • NAVERクラウドプラットフォームで提供する Object Storageと Bucketが必要です。このサービスに関する詳細は、Object Storage の概要で確認できます。
    • Veleroを使用する前にアウトバウンドインターネットトラフィックを有効にするため、必ず NAT Gatewayを作成します。
    • 使用中の NAVERクラウドプラットフォームアカウントの AccessKeyと SecretKey情報が必要です。

    Veleroのインストール

    Veleroプラグインをインストールするには、以下の手順に従って行います。

    1. Veleroクライアントインストール
    2. Secret登録
    3. Veleroサーバインストール
    4. スナップショット設定

    1. Veleroクライアントインストール

    1. Velero GitHubリポジトリからインストールするバージョンのクライアントをダウンロードします。

    2. 下記のコマンドを実行して/tmpフォルダに移動します。

      $ cd /tmp
      
    3. 以下のコマンドを実行して release tarballをダウンロードします。

      $ wget https://github.com/vmware-tanzu/velero/releases/download/[version]/[release matched to OS and Architecture]
      
      ex) wget https://github.com/vmware-tanzu/velero/releases/download/v1.10.3/velero-v1.10.3-linux-amd64.tar.gz
      
    4. 以下の tarコマンドを実行してダウンロードしたファイルを解凍します。

      $ tar -xvzf velero-v1.10.3-linux-amd64.tar.gz
      
      • /tmpパスにある velero-v1.10.3-linux-amd64の Veleroバイナリを利用して正常にダウンロードされたことを確認できます。
    5. 以下のコマンドを実行してダウンロードしたファイルを/usr/local/binパスに移動します。

      $ sudo mv velero-v1.10.3-linux-amd64/velero /usr/local/bin/velero  
      

    2. Secret登録

    以下のコマンドを実行して次の値を入力します。

    • aws_access_key_id: AccessKey
    • aws_secret_access_key: SecretKey
    • region: clusterが属する region(KR、SGN、JPN)
    • server_api_uri: Server(VPC) API URI
    $ vi cloud-credential
    
    [default]
    aws_access_key_id=<ACCESS_KEY_ID>
    aws_secret_access_key=<SECRET_ACCESS_KEY>
    region=<REGION>
    server_api_uri=https://ncloud.apigw.ntruss.com/vserver/v2
    

    3. Veleroサーバインストール

    以下のコマンドを実行して Veleroサーバをインストールします。--bucket velero-backupで velero-backupの内容を NAVERクラウドプラットフォーム内の Object Storageの Bucket名に変更する必要があります。

    • IMAGE_REGISTRY:
      • KR: nks.kr.private-ncr.ntruss.com/
      • SGN: nks.sg.private-ncr.ntruss.com/
      • JPN: nks.jpn.private-ncr.naverncp.com/
    • S3_URL:
      • KR: https://kr.object.private.ncloudstorage.com
      • SGN: https://sg.object.private.ncloudstorage.com
      • JPN: https://jp.object.private.ncpstorage.com
    velero install \
      --kubeconfig $KUBE_CONFIG \
      --provider velero.io/aws \
      --bucket velero-backup \
      --plugins velero/velero-plugin-for-aws:v1.6.2,<IMAGE_REGISTRY>/velero-plugin-for-ncloud:v0.0.8 \
      --backup-location-config region=kr,s3ForcePathStyle="true",s3Url=<S3_URL> \
      --use-volume-snapshots=false \
      --secret-file=./cloud-credential
    

    インストールが完了すると、以下のコマンドを実行して確認できます。

    $ kubectl --kubeconfig $KUBE_CONFIG get deployment/velero --namespace velero
    

    4. スナップショット設定

    クラスタブロックストレージのスナップショットを正常に作成できるように、以下のコマンドを実行して NAVERクラウドプラットフォームで提供するプラグインを基本スナップショットプロバイダーに指定します。

    $ velero --kubeconfig $KUBE_CONFIG snapshot-location create default --provider ncloud/volume-snapshotter-plugin
    

    この記事は役に立ちましたか?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.