VPC環境で利用できます。
Kubernetesのクラスタのバックアップが必要な場合、Veleroプラグインを使用します。Veleroを通じて Kubernetesオブジェクトを Object Storageに圧縮・バックアップできます。また、クラスタの PersistentVolumeに対するスナップショットを作成してクラスタのオブジェクトと PersistentVolumeを以前のステータスに復元できます。使用する前に以下をご参照ください。
- このガイドは Ubuntu 20.04 OSと Velero v1.14.1を基準に作成されました。
- NAVERクラウドプラットフォームで提供する Object Storageと Bucketが必要です。このサービスに関する詳細は、Object Storage の概要で確認できます。
- Veleroを使用する前にアウトバウンドインターネットトラフィックを有効にするため、必ず NAT Gatewayを作成します。
- 使用中の NAVERクラウドプラットフォームアカウントの AccessKeyと SecretKey情報が必要です。
Ncloud Kubernetes Service環境で Veleroと NKS間のバージョン互換性に関する情報は、次の通りです。
| Veleroバージョン | NKSバージョン |
|---|---|
| 1.10 | 1.24, 1.25, 1.26, 1.27, 1.28 |
| 1.14 | 1.27, 1.28, 1.29, 1.30, 1.31, 1.32, 1.33, 1.34 |
Veleroのインストール
Veleroプラグインをインストールするには、以下の手順に従って行います。
1. Veleroクライアントのインストール
2. Secretの登録
3. Veleroサーバのインストール
4. スナップショットの構成
1. Veleroクライアントのインストール
-
Velero GitHub保存場所からインストールするバージョンのクライアントをダウンロードします。
-
下記のコマンドを実行して/tmpフォルダに移動します。
$ cd /tmp -
以下のコマンドを実行して 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.14.1/velero-v1.14.1-linux-amd64.tar.gz -
以下の tarコマンドを実行してダウンロードしたファイルを解凍します。
$ tar -xvzf velero-v1.14.1-linux-amd64.tar.gz- /tmpパスにある velero-v1.14.1-linux-amd64の Veleroバイナリを利用して正常にダウンロードされたことを確認できます。
-
以下のコマンドを実行してダウンロードしたファイルを/usr/local/binパスに移動します。
$ sudo mv velero-v1.14.1-linux-amd64/velero /usr/local/bin/velero
2. Secretの登録
以下のコマンドを実行して次の値を入力します。
aws_access_key_id: AccessKeyaws_secret_access_key: SecretKeyregion: 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.12 \
--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