Skip to content

Create Backup of a pod in namespace test-ns1, test-ns2 and then restore the backup to the namespace restore-ns from only test-ns1 #169

@piyushsharma0211

Description

@piyushsharma0211

Issue/Feature Description:
Testcase Precondition:

  1. Kahu project installed in given name-space (test-kahu)
  2. All below pods should be up and running:
    a. backup service
    b. Meta service with nfs provider
    c. nfs-server
  3. Metadata location is created already
  4. Namespace test-ns1, test-ns2 is created and contains some of the kubernetes resources
    5.Namespace restore-ns is created
    Testcase steps:
  5. Create below backup CR using kubectl command
    (use kubectl create -f <backup.yaml>)
    apiVersion: kahu.io/v1
    kind: Backup
    metadata:
    name: backup-Kahu-0001
    spec:
    includeNamespaces: [test-ns1, test-ns2]
    metadataLocation: nfs
    includeResources:
  • name:
    kind: Pod
    isRegex: true
  1. Use kubectl describe backup -n test-kahu
  2. Get inside nfs server pod and check for the content inside mount path given
    (Use command kubectl exec -ti -n test-kahu /bin/sh)
  3. Create a restore CR on new namespace (restore-ns)
    apiVersion: kahu.io/v1
    kind: Restore
    metadata:
    name: restore-Kahu-0001
    Spec:
    backupName: backup-Kahu-0001
    includeNamespaces: [test-ns1]
    namespaceMapping:
    test-ns1: restore-ns
    Expected Result:
  4. In step 2,
    a) Verify that backup stage is Finished and State is Completed
    b) Verify the resource list in status shows all the required resources
  5. In step 3, verify that
    a) tar file is created with name of backup
    b) After untar file, all deployments and pods are backup. but point to note, the pod which
    has owner reference will not be backup
  6. In step4, verify that
    a) Backed up pod is up in namespace test-ns

Why this issue to fixed / feature is needed(give scenarios or use cases):

How to reproduce, in case of a bug:

Other Notes / Environment Information: (Please give the env information, log link or any useful information for this issue)

@sushanthakumar
@kalaiselvikks76

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions