Solved

K10 Migrate entire namespace of applications with transformation change namespace

  • 14 November 2022
  • 3 comments
  • 130 views

Userlevel 2

Hello,

I am in the process of trying to migrate about 7 applications within a single namespace to a new cluster.  I have the backup/exports [references only] from the source working and I can import on the destination side.
 

Question(s):

  1. Can you transform ALL (deployments, configmaps, secrets, statefulesets, pvc, daemonsets) resources with a path of “/metadata/namespace” to something new, while doing the auto-restore?
    1. Without doing one application/resource at a time
    2. Is there a way to set the Transform subject to multiple items?
      1. Assume the answer is no but….

Environment:

  • K8 on-prem
    • source: v1.21.1
    • destination: v1.24.2
  • K10 v5.0.4 (both)
    • Shared S3 bucket between both K10 just for migrations
icon

Best answer by FRubens 14 November 2022, 19:16

View original

3 comments

Userlevel 2

The only logical way I can see this happening is:

  1. Restore the migrated/imported application into the destination cluster as-is (don’t change anything)
    1. This will only work if the source & destination have the same storageclass names
  2. On the destination cluster:
    1. Once all the applications have been restored
      1. Take backup/snapshot of the namespace
      2. Restore within cluster to new namespace
Userlevel 4
Badge +2

Hello @abiwot 

Thank you for using or community.

First I would like to point out, since I noticed you are using latest k8s version on target cluster, K10 does not support k8s 1.24 as yet, planned to be supported soon.

Regarding transformations, you can apply while importing to your target cluster, when you select "Restore After import" checkbox, and each transform can be applied to a specific resource using group, version, resource type and name, or if you want to apply i.e. all PVCs to have a different storageclass, you can create a transform specifying only the version and resource as "persistenvolumeclaims" and all PVCs will be affected by this transform.

That means you can apply transform to multiple resources of the same type without specifying a name, but in the actual version it is not possible to apply a general transform that would affect all type of resources in the namespace in a single operation.

More information can be found in our docs: https://docs.kasten.io/latest/usage/restore.html?highlight=transformation#resource-transformation

Please let me know if you have any further questions.

Regards
Fernando

Userlevel 2

@FRubens 
I figured that was going to be the answer.  Thanks for confirming.

I guess I will go back to the multi-stage approach to migrate these.  Few extra steps but prevents transforms from getting too complicated.

Comment