1

In a Kubernetes cluster I have several apps deployed in the same namespace called "default". An app consist of a webserver pod and a database pod.

How to restore one single app in the original cluster from a backup plan from Backup for GKE?

In the cluster I have defined several ProtectedApplication's for the backup agent for it to identify the distinct applications (websites). This definitions looks like:

kind: ProtectedApplication
apiVersion: gkebackup.gke.io/v1alpha2
metadata:
  name: test
  namespace: default
spec:
  resourceSelection:
    type: Selector
    selector:
      matchLabels:
        app.kubernetes.io/instance: test
  components:
    - name: wordpress
      resourceKind: Deployment
      resourceNames: ["test-wordpress"]
      strategy:
        type: BackupAllRestoreAll
        backupAllRestoreAll: {}
    - name: mariadb
      resourceKind: StatefulSet
      resourceNames: ["test-mariadb"]
      strategy:
        type: BackupAllRestoreAll
        backupAllRestoreAll: {}

My main concern is about the option "Define conflict handling" in the restore plan configuration:

Define conflict handling creating a restore plan

It says:

Any conflicting namespaces in the target cluster (along with all their contained resources) will be deleted before a non-destructive restore is performed.

Does it really removes the entire "default" Kubernetes namespace before restoring only the protected application? I hope it only removes the resources inside the Kubernetes namespace that has the same names as found inside the backup that is to be restored. Can someone help me out here?

1 Answer 1

2

Good news! The restore procedure does not remove the whole namespace. But only the artifacts belonging to the ProtectedApplication are first removed, then restored from backup. Perfect!

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .