In this topic
Properties for the MySQLBackupLocation Resource
Properties for the Secret
Properties for the MySQLBackupSchedule Resource
Properties for the MySQLBackup Resource
Properties for the MySQLRestore Resource

This topic contains property reference tables for the resources that you create for performing backup and restore. For information about backup and restore, see Backing Up and Restoring MySQL Instances.

Properties for the MySQLBackupLocation Resource

The table below explains the properties that can be set for the MySQLBackupLocation resource.

Property Type Default Description Example Req?
metadata.name String n/a The name of the MySQLBackupLocation. Must be unique within a namespace. backuplocation-sample Yes
spec.retentionPolicy.type String Days The type of measure for retention duration, such as number of days. Days No
spec.retentionPolicy.days integer n/a The minimum age in days of the oldest backup retained. There will be one backup of this age or older. When there are multiple backups older than this, taking a new backup will trigger deletion of all but one backup of the retention age. An omitted or zero value indicates all backups should be retained (i.e. no deletion policy). 21 No

S3 configuration

Property Type Default Description Example Req?
spec.storage.s3.bucket String n/a The name of an existing S3-compatible bucket for this backup location. s3-bucket-sample Yes
spec.storage.s3.bucketPath String n/a The name of the path where backup artifacts will be uploaded. If a folder in the path does not already exist, it is created automatically. s3-sample-path/sample-subpath/ No
spec.storage.s3.region String us-east-1 The geographic region of the bucket. Some non-AWS S3 implementations do not require this value. us-west-1 No
spec.storage.s3.endpoint String https://
BUCKET-NAME
.s3.REGION
.amazonaws.com/
The endpoint URL for the configured S3-compatible provider. Leave blank for AWS S3. http://minio.default:9000 No
spec.storage.s3.caBundle String n/a The PEM encoded CA bundle, which will be used to validate the storage endpoint TLS certificate. No
spec.storage.s3.forcePathStyle boolean false true forces the use of path-style S3 URLs for compatibility. May be required for some non-AWS S3 providers.
false uses virtual hosted-style S3 URLs.
For information about AWS S3 Path Deprecation, see the AWS blog site .
false No
spec.storage.s3.secret.name String n/a The name of the Kubernetes secret that contains the credentials for connecting to S3. backuplocation-sample-creds Yes

Azure configuration

Property Type Default Description Example Req?
spec.storage.azure.container String n/a The name of an existing Azure storage container in Azure Blob Storage. azure-backups-sample Yes
spec.storage.azure.repoPath String n/a The name of the path where backup artifacts will be uploaded. If a folder in the path does not already exist, it is created automatically. buckets-sample-path/sample-subpath/ No
spec.storage.azure.domain String blob.core.windows.net The storage endpoint for the Azure cloud environment. Leave blank for public cloud. blob.core.usgovcloudapi.net No
spec.storage.azure.caBundle String n/a The PEM encoded CA bundle that is used to validate the storage endpoint TLS certificate. No
spec.storage.azure.secret.name String n/a The name of the Kubernetes secret that contains the credentials for connecting to Azure. backuplocation-sample-creds Yes

Properties for the Secret

The table below explains the properties that can be set in the secret for the MySQLBackupLocation resource.

Property Type Default Description Example Req?
metadata.name String n/a The name of the Secret. Must match spec.storage.s3.secret.name or spec.storage.azure.secret.name in a BackupLocation. Must be unique within a namespace. backuplocation-sample-creds Yes

S3 credentials

Property Type Default Description Example Req?
stringData.accessKeyId String n/a The Access Key ID for an AWS IAM user that has permissions to read/write from the S3 bucket. AKIAIOSFODNN7EXAMPLE Yes
stringData.secretAccessKey String n/a The Secret Access Key for an AWS IAM user that has permissions to read/write from the S3 bucket wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY Yes

Azure credentials

Please provide either a shared access key or a shared access signature token to authorize access to the container in Azure Blob Storage.

Property Type Default Description Example Req?
stringData.accountName String n/a The storage account name in the Azure cloud environment. my-storage-account Yes
stringData.accountKey String n/a The storage access key to read/write from the container in the storage account. my-storage-access-key Yes, or set sasToken instead
stringData.sasToken String n/a The shared access signature token with the appropriate permissions on the container in the storage account. storage-access-token-value Yes, or set accountKey instead

Properties for the MySQLBackupSchedule Resource

The table below explains the properties that can be set for the MySQLBackupSchedule resource.

Property Type Default Description Example Req?
metadata.name String n/a The name of the MySQLBackupSchedule. Must be unique within a namespace. backupschedule-sample Yes
spec.backupTemplate.spec.location.name String n/a The name of the MySQLBackupLocation that represents the blobstore where backups will be uploaded. Must be in the same namespace as the MySQLBackupSchedule. backuplocation-sample Yes
spec.backupTemplate.spec.instance.name String n/a The name of the MySQL instance on which you want scheduled backups for. Must be in the same namespace as the MySQLBackupSchedule. mysql-sample Yes
spec.schedule String (cron schedule) n/a The cron schedule for backups. Must be a valid cron schedule. "0 23 * * 6" (every Saturday at 11PM) Yes
spec.binaryLogCollection.enabled boolean false Enables binary log collection true No
spec.binaryLogCollection.flushInterval duration 5m MySQL binary logs are flushed based on this interval. 6h No
spec.binaryLogCollection.resources ResourceRequirements n/a Specifies Resource Requirements limits: {cpu: 100m} No

More information on the ResourceRequirements Property

You can specify the CPU and Memory of the ResourceRequirements property.

Memory specifies the amount of memory allocated to a container and defines a memory limit. If a pod tries to exceed the limit, the pod is removed and replaced by a new pod. Memory units may use a suffix, for example, 4.5Gi. For more details on resource allocation in Kubernetes, see Assign Memory Resources to Containers and Pods in the Kubernetes documentation.

CPU is the amount of CPU resources allocated to a container, specified as a Kubernetes CPU unit, for example, cpu: "1.2". If you do not provide a valur for CPU, it inherits the default limit of its namespace (if a limit exists) or has no limit on the CPU consumed. For more details on resource allocation in Kubernetes, see Assign CPU Resources to Containers and Pods in the Kubernetes documentation.

Example:

apiVersion: with.sql.tanzu.vmware.com/v1
kind: MySQLBackupSchedule
metadata:
  name: backupschedule-sample
spec:
  backupTemplate:
    spec:
      location:
        name: backuplocation-sample
      instance:
        name: mysql-sample
  schedule: "@daily"
  binaryLogCollection:
    enabled: true
    flushInterval: 5m
    resources:
      limits:
        cpu: 100m
        memory: 100Mi
      requests:
        cpu: 100m
        memory: 100Mi

Note: These values are examples of values. They are not recommended values.

Properties for the MySQLBackup Resource

The table below explains the properties that can be set for the MySQLBackup resource.

Property Type Default Description Example Req?
metadata.name String n/a The name of the MySQLBackup. Must be unique within a namespace. backup-sample Yes
spec.location.name String n/a The name of the MySQLBackupLocation that represents the blobstore where the backup will be uploaded. Must be in the same namespace as the MySQL instance. backuplocation-sample Yes
spec.instance.name String n/a The name of the MySQL instance on which you want to perform the on-demand backup. my-instance Yes

Properties for the MySQLRestore Resource

The table below explains the properties that can be set for the MySQLRestore resource.

Property Type Default Description Example Req?
metadata.name String n/a The name of the MySQLRestore. Must be unique within a namespace. restore-sample Yes
spec.backup.name String n/a The name of the MySQLBackup that represents the backup artifact to restore. Must be in the same namespace as the MySQLRestore. backup-sample Yes
spec.instanceTemplate MySQL n/a The configuration for the MySQL instance that the backup artifact will be restored to. This MySQL instance is created automatically as part of the restore, so the name must not already exist in the namespace.
For descriptions of each value in the configuration template, see Create a MySQL Instance .
See example below.* Yes
spec.instanceTemplate.spec.imagePullSecretName String n/a The name of the secret used to restore the backup pulled from the instance spec. MySQLRestore will default to use the imagePullSecretName that is configured in the helm chart, when the user does not provide it. tanzu-image-registry No
spec.pitr.type String n/a Type specifies the mode of recovery. `Latest` means all available binary logs after the full backup are applied. `Timestamp` restores all the available binary logs until the specified timestamp after the full backup. Latest No
spec.pitr.timestamp String (Timestamp) n/a This `Timestamp` is used to restore all the available binary logs until the specified timestamp after the full backup. "2023-05-25T19:22:15Z" No
spec.searchBackupLocation.instanceName String n/a InstanceName is used to find backups for a MySQL instance with this name. mysql-instance No
spec.searchBackupLocation.instanceUid String n/a InstanceUid will be used to find backups for a MySQL instance with this uid 4e1677b5-9b9a-4b2a-bd90-9799441a145f No


* The type MySQL is a nested YAML object. For example:

metadata:
  name: mysql-sample
spec:
  storageSize: 1Gi
  highAvailability:
    enabled: true
check-circle-line exclamation-circle-line close-line
Scroll to top icon