Velero plugin

Prev Next

Available in VPC

You can use Velero plugin if a Kubernetes cluster needs to be backed up. Kubernetes objects can be compressed and backed up to object storage through Velero, and the cluster's PersistentVolume snapshots can be created to restore the cluster objects and PersistentVolume to their previous states. Take note of the following before use:

  • This guide is created based on Ubuntu 20.04 OS and Velero v1.14.1.
  • Object Storage and Bucket provided by NAVER Cloud Platform are required. For more information, see Object Storage overview.
  • To enable the outbound Internet traffic before using Velero, you must create NAT Gateway.
  • AccessKey and SecretKey information of NAVER Cloud Platform account in use is required.
Note

Velero version compatibility information between Velero and NKS in the Ncloud Kubernetes Service environment is as follows:

Velero version NKS version
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

Install Velero

To install Velero plugin, proceed with the following steps in order:

1. Install Velero client
2. Register secret
3. Install Velero server
4. Configure snapshot

1. Install Velero client

  1. Download the client in the version you want to install from the Velero GitHub storage.

  2. Run the following command to go to the /tmp folder:

    $ cd /tmp
    
  3. Run the following command to download the 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
    
  4. Run the following tar command to decompress the downloaded file:

    $ tar -xvzf velero-v1.14.1-linux-amd64.tar.gz
    
    • You can check if it is downloaded properly by using Velero binary of velero-v1.14.1-linux-amd64 in the /tmp path.
  5. Run the following command to move the downloaded file to the /usr/local/bin path:

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

2. Register secret

Run the following command to enter the following value:

  • aws_access_key_id: AccessKey
  • aws_secret_access_key: SecretKey
  • region: regions where the cluster belongs to (KR, SGN, and 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. Install Velero server

Run the following command to install Velero server: In --bucket velero-backup, change the content of velero-backup to the name of the Bucket of the Object Storage within NAVER Cloud Platform.

  • 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

You can run the following command to check after the installation is completed:

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

4. Configure snapshot

In order to create a snapshot of the cluster block storage, run the following command to designate the plugin provided by NAVER Cloud Platform as the default snapshot provider:

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