ClusterBackup resource

This section describes the ClusterBackup custom resource (CR) used in the MOSK management API to configure a MOSK or management cluster backup.

The ClusterBackup CR contains the following fields:

  • apiVersion

    API version of the object that is kaas.mirantis.com/v1alpha1.

  • kind

    Object type that is ClusterBackup.

  • metadata

    Metadata of the ClusterBackup CR that contains the following fields:

    • name

      Name of the ClusterBackup object.

    • namespace

      Project name of the cluster that relates to ClusterBackup.

    After the ClusterBackup object is created, the metadata section also contains details about the target cluster requesting the backup and identifiers of the ClusterBackup object:

    • ownerReferences

      Details about the owner of the ClusterBackup object. Contains the following fields:

      • apiVersion

        API version of the target Cluster object that owns the ClusterBackup object.

      • kind

        Object type of the target Cluster object that owns the ClusterBackup object.

      • name

        Name of the target Cluster object that owns the ClusterBackup object.

      • uid

        Reference to the targetCluster field located in the spec section of the ClusterBackup object.

    • resourceVersion

      Resource version of the ClusterBackup object.

    • uid

      Unique identifier of the ClusterBackup object.

  • spec

    Specification of the ClusterBackup CR that contains the following fields:

    • parameters

      Parameters of the ClusterBackup CR. If empty, MOSK replaces it with the backup section values of the target Cluster object spec, if any. If backup parameters are configured neither through the Cluster nor through the ClusterBackup object, a local backup will be created and stored on one of the MKE manager nodes of the target cluster.

      Contains the following fields:

      • keyEncryptionKey

        Name of the Kubernetes secret that contains the encryption key that is used to encrypt the backup data. Requires either rclone or nfsUploadUrl field to be set.

      • nfsUploadUrl

        NFS URL for the backup data upload. For example, nfs://1.2.3.4:/path. Mutually exclusive with the rclone field.

      • rclone

        Parameters of the rclone configuration. Mutually exclusive with the nfsUploadUrl field. Contains the following fields:

        • bucket

          Name of the remote rclone bucket containing the folder for the backup. Can be either a bucket name, or a bucket name with subfolders, if any. For example, my-bucket or my-bucket/mke-backups/cluster1.

        • credential

          Name of the RCloneCredential object that contains the credentials for the remote storage bucket.

    • targetCluster

      Name of the target cluster for a backup.

    • fileNames

      Optional list of custom file names for the required application backups. Contains the following field:

      • MKE

        Custom file name for the MKE backup. For example, my-mke-backup.tar.

      If any file with the specified name already exists in the remote storage, it will be overwritten. If any backup with the specified name already exists in MKE, the backup will fail with the corresponding error.

    • createdBy

      Details about the user who initiated the backup. Contains the following field:

      • <user_type>

        Details about the user who initiated the backup. Possible user types:

        • user

          Details about the Keycloak user who initiated the backup. Contains the following field:

          • uid

            UUID of a user in Keycloak. For example, uid: 123e4567-e89b-12d3-a456-426614174000. If using a certificate, the uid is the common name of this certificate.

        • updateRelease

          Details about the update release that initiated the backup. For example, updateRelease: mke-20.0.0-3.7.24 indicating that the backup was initiated by the Cluster release 20.0.0 containing the MKE release 3.7.24.

        • schedule

          Name of the backup schedule that initiated the backup. For example, schedule: test-schedule.

    • delete

      Configuration of the remote backup deletion. Boolean. Set to true to request remote backup deletion.

      Note

      Deletion of the ClusterBackup object itself only triggers deletion of related Kubernetes objects created during backup. Therefore, always request deletion from the remote storage backend using the delete field before deleting the object itself.

  • status

    Status of the ClusterBackup CR. Contains the following fields:

    • completedAt

      Timestamp of the backup completion.

    • deletedAt

      Timestamp of the backup deletion.

    • fileNames

      List of file names included in the backup.

    • startedAt

      Timestamp of the backup start.

    • uploadedAt

      Timestamp of the backup upload to the target storage.

    • status

      Status of the backup on the remote storage. Possible values:

      • Completed

        Backup has been completed.

      • Deleted

        Backup has been deleted.

      • DeleteFailed

        Backup deletion has failed.

      • DeletionInProgress

        Backup deletion is in progress.

      • DeletionPending

        Backup deletion is pending.

      • Failed

        Backup has failed.

      • InProgress

        Backup is in progress.

      • Pending

        Backup is pending.

      • Stuck

        Backup is stuck and requires manual intervention.

      • UploadingInProgress

        Backup upload is in progress.

      • UploadPending

        Backup upload is pending.

Configuration example of a completed ClusterBackup object encrypted by a referenced encryption key and uploaded to a remote rclone storage:

apiVersion: kaas.mirantis.com/v1alpha1
kind: ClusterBackup
metadata:
  creationTimestamp: "2026-01-15T17:39:30Z"
  finalizers:
  - kaas.mirantis.com/clusterbackup-finalizer
  generation: 1
  name: test-create-clusterbackup
  namespace: default
  ownerReferences:
  - apiVersion: cluster.k8s.io/v1alpha1
    kind: Cluster
    name: kaas-mgmt
    uid: 89d9764e-cab6-40b0-9368-c4fcebde0aa4
  resourceVersion: "1237765"
  uid: 9f2d7888-6da2-4f6e-8547-4c1b4533e442
spec:
  createdBy:
    user:
      uid: admin
  parameters:
    keyEncryptionKey: swift-s3
    rclone:
      bucket: test
      credential: swift-s3
  targetCluster: kaas-mgmt
status:
  completedAt: "2026-01-15T17:40:26Z"
  fileNames:
    MKE: test:test-create-clusterbackup.encrypted
  startedAt: "2026-01-15T17:40:19Z"
  status: Completed
  uploadedAt: "2026-01-15T17:42:22Z"