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:
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?