CLI
First of all, check the current overall status of the cluster backup subsystem:CONFIGURATION NAME and CONFIGURATION ERROR fields display the current backup store configuration status.
Currently, Omni supports two backup stores: local and s3.
These are configured during Omni initialization.
The output above indicates that the backup store is set to use the s3 store.
However, the s3 configuration itself has not yet been added, so the CONFIGURATION ERROR field shows not initialized.
The rest of the fields show as empty because no backups have been created yet.
S3 configuration
To use S3 as the backup storage, you will first need to configure the S3 credentials for Omni to use. This can be done by creating anEtcdBackupS3Configs.omni.sidero.dev resource in Omni.
Below is an example for Minio S3:
bucket- the name of the S3 bucket for storing backups. This is the only field required in all cases.region- the region of the S3 bucket. If not provided, Omni will use the default region.endpoint- the S3 endpoint. If not provided, Omni will use the default AWS S3 endpoint.accesskeyidandsecretaccesskey- the credentials to access the S3 bucket. If not provided, Omni will assume it runs in an EC2 instance with an IAM role that has access to the specified S3 bucket.sessiontoken- the session token (if any) for accessing the S3 bucket.
<file-name>.yaml and apply using omnictl apply -f <file-name>.yaml.
During resource creation, Omni will validate the provided credentials by attempting to list the objects in the bucket.
It will return an error if the validation fails and will not update the resource.
Letβs get our overall status again and check the output:
CONFIGURATION ERROR field is now empty, indicating that the provided configuration is valid.
Manual backup
Now, letβs create a manual backup. To do that, we need to create a resource:<unix-timestamp> should be no more than one minute in the future or in the past. The easiest way to get the
current timestamp is to simply invoke date +%s in your shell. The nanos field should always be 0.
After you save the resource as <file-name>.yaml, apply it using omnictl apply -f <file-name>.yaml.
In a few seconds, you can check the status of the backup:
Automatic backup
Omni also supports automatic backups. You can enable this feature by directly editing the cluster resourceClusters.omni.sidero.dev or by using cluster templates. Letβs explore how we can do this in both ways.
Cluster templates
Enabling automatic backups using cluster templates is quite straightforward. First, youβll need a template that resembles the following:clustermachinestatus and cluster resources.
In this example, we are going to set the backup interval for the cluster to one hour. Save this template
as <file-name>.yaml. Before applying this change, we want to ensure that no automatic backup is enabled for this
cluster. To do that, letβs run the following command:
omni.sidero.dev/cluster
along with your cluster name. In this example it is talos-default.
Cluster resource
Another way to enable automatic backups is by directly editing the cluster resource. To do this, first, youβll need to retrieve the cluster resource from the Omni:omnictl apply -f <file-name>.yaml. You will get the output similar to the one
above for the cluster template.